I actually have had great success with a divided five gallon tank with two bettas. I disagree that bettas need five gals, when I have two beautiful happy bettas in one. It's the best I can give them. And I know this is a touchy subject, and this is just my opinion.
I found this online and I used it and it was super easy, and very inexpensive.
DIY Aquarium Tank Dividers
Instead of the white piece of mesh, I actually used black. The bettas can't see each other with the darker color. It's not stressful on the fish, and it allows easy flow from the filter and heater to both sides.