Well, that's the $60 question isn't it. Can you figure out what the wire gauge is that is going into the 40amp breaker? If it's 6 gauge, you could put a 50amp breaker in and run an inline spa panel to get your GFI. The typical non-GFI 50a breaker is about $15 and the spa panel is another $50. If your main panel by some chance is a General Electric, you may be able to directly put the spa panel's GFI breaker in. If not, you'll find a standalone 50a GFI breaker is way over $100. I have no idea why.