I posted this up elsewhere, but $40k can be paid off in five years if you toss $800/mo at it. That's hardly an insurmountable debt burden. Sure, it sucks, but it's gone before well before most people would turn 30.
But yes, bankruptcy should absolutely apply to student loan debt if the individual can't pay.