No. I know that Hogs are generally listed at being around 5 feet, but it's not IMPOSSIBLE for them to get larger. Plus they're THICK snakes. A 40 gallon is going to be WAY too cramped.

If you want to stay with the glass tank look (which I do NOT recommend) you're looking at a 75 gallon tank for life.

I highly suggest investing in a boaphile, animal plastics, vision cage set up. Radiant heat panels are a tad expensive but guaranteed for life and well worth the cash.