Commenter Downfall notes:

It is also worth noting that your 401(k) is protected in bankruptcy proceedings. So, to the extent you're considering a 401(k) loan to pay off debt, it often simply makes more sense to declare chapter 7 or 13. Depending on what you own, most of your assets may be shielded by various exemptions. Don't do anything rash without consulting a bankruptcy lawyer.

In general, the point at which you're kiting debt--using home equity or the 401(k) to pay off credit cards or bad car loans--is the point at which you are in serious financial trouble.  While transforming the debt to lower-interest rate forms can seem like salvation, it's not the answer.  For one thing, the lower interest rates come with greater risk--of losing the house or your retirement savings, rather than your credit rating.  For another, it won't work unless you get serious about controlling your money.  I've watched colleagues do it (not at the Atlantic), and invariably after they refinanced the house, the credit card debt started to creep up again.  Many financial counselors and personal finance gurus say the same thing.

Bankruptcy may be the only answer.  But even before you contact a bankruptcy attorney, you need to sit down and get serious about your money.  Get out your bank statements and look at all your expenses, including the cash withdrawals.  Look at your fixed costs, and see how much that leaves you for variable expenses like food.  You may simply be overspending on crap, in which case I am a big fan of the cash budget, and have been since my early days as a broke young journalist with monstrous student loan payments.  Cash provides automatic discipline; it's hard to rationalize overspending when you can see just how little is left for the rest of the month.

Or you may have excessive fixed costs.  If the fixed costs don't leave you enough room for food, utilities, and sundries like car repairs, then you need to bite the bullet and shed some of them.  That may mean letting go of a treasured car, boat, or house.  Even more painfully, it may mean coming up with cash to pay the difference, if the asset is underwater.  Again, if it's bad enough that you need to kite debt, it's bad enough that you need to be an adult and let the beloved, debt laden possessions go.

But that may not be enough.  You may have giant medical bills, or huge credit card debts that simply mean outflow will never match inflow.  Kiting can be a solution to this, but it's really risky, as I've noted.  I've heard Elizabeth Warren advise against refinancing credit card debt into the house, and on this we agree.  It's better to lose your credit rating than your house.  I'd say the same about your 401(k).

Bankruptcy may be the solution to excessive unsecured debts (it's not for tax debt, and almost never for student loan debt unless you're totally and permanently disabled; if you have those kinds of debts, then you just need to work something out with the relevant authorities.)  But before I talked to a BK attorney, I'd try to settle these--stop making payments, save up enough to offer, say, 50 cents on the dollar, and then call with a settlement offer.  Yes, you  will trash your credit rating.  But so will bankruptcy, for longer.  You won't lose much by trying to work out settlements before you try the neutron bomb attack on your debt.

If that fails--if they garnishee your wages, or attach your checking account, or send bailiffs to take the furniture--then it's definitely time to talk to a bankruptcy attorney.  But I'd do all of those things, including a bankruptcy, before I'd put my house or my retirement at risk.

Update:  Downfall offers more in the comments

I agree with every word of this post. In the bankruptcy cases I see and read about, the things you describe didn't work out. But there's obvious selection bias there in that, if they did work out, the bankruptcy case wouldn't exist in the first place. A commentor on the last thread also said to see a CFP before a bankruptcy attorney, and that might be a good idea too.

The debt settlement is a good idea, just avoid those shady debt settlement agencies. The big takeaway is to never risk an asset you can protect, such as a home or a 401(k)/IRA, to satisfy debt that can be discharged. As you note, generally bankruptcy is useless for taxes and student loans.

And, finally, I highly recommend mint.com for tracking where your money is going. It's completely automated, so there's no bias (except it's difficult to manually input cash transactions). Most people I know who have signed up for this completely free service have been shocked at how much they spend on coffee and the like.

Roger that, especially Mint.  I use it to keep track of our finances, and it's a godsend.  They've now added goal tracking where you can pay off debt or set savings goals, and it's incredibly helpful to be able to visualize where you stand.