My big female is in a 40 long. She is about 4 to 4.5 feet long. I was reading that small males can stay in a 20 long, but that seems nuts to me.
Basically, the tank should be half as long as your snake. A 6 foot snake needs a 3 foot long tank. Most bps don't get that long and a 40g will be just fine.