Bankruptcy is not as bad as everyone makes it out to be. You can get an FHA mortgage 1-2 years (depending on circumstances) after the discharge date. You can get a non-QM (not Fannie/Freddie/FHA backed) loan the next day at a higher interest rate (~200-300 basis points above prime), which you're only going to carry for two years until you can FHA refi. You'll get a secured credit card. You'll pay more for an auto loan. But you'll get credit nevertheless because you can't go BK again for another 7 years. You will pay more for that credit, but you will still get it. Walking away from certain levels of dischargeable debt is entirely reasonable. That is why we have bankruptcy as a financial tool.
Some states are better about protections against creditors than others. Don't live in a state with poor creditor protections (Florida is fantastic, Missouri is terrible).