S&P’s $5 trillion bank doomsday tab

April 18, 2011, 10:22 PM UTC

Political gridlock and fiscal bloat aren’t the United States’ only problems.

Those are the issues that prompted Standard & Poor’s to raise a red flag over the U.S. credit rating Monday, certainly. But there’s a third factor worth considering: the risk that the U.S. economy could crash, bringing down the financial sector yet again and forcing everyone but Jamie Dimon (right) and Lloyd Blankfein to dig deep into their pockets to prop it back up.

Hasnt he given enough already?

While a full-fledged crash obviously is unlikely to happen, S&P is saying that cleaning up a banking mess would cost much more now than ever before. It put the upfront cost of government support for the financial sector in a so-called economic stress situation at $5 trillion – up from its 2007 estimate of $3.9 trillion.

The rating agency points to the massive cost of resolving and relaunching Fannie Mae and Freddie Mac, the taxpayer-backed mortgage investors, and to its estimate last year that U.S. banking loan losses could be as much as twice as big in a downturn as it previously estimated.

“Additional fiscal risks we see for the U.S. include the potential for further extraordinary official assistance to large players in the U.S. financial or other sectors, along with outlays related to various federal credit programs,” S&P said.

As you may recall from 2008 and 2009, what happens when the economy runs aground and the banks run out of money is that taxpayers have the pleasure of coming in to make the bankers whole. If things go really wrong, S&P says setting things right could consume up to a third of a full year’s economic output.

“We now estimate the maximum aggregate, up-front fiscal cost to the U.S. government of resolving potential financial sector asset impairment in a stress scenario at 34% of GDP compared with our estimate of 26% in 2007,” S&P said.

That’s not to say a bailout necessarily has to cost that much. An International Monetary Fund assessment of the 2008 financial meltdown puts the cleanup cost for the United States at $500 billion. Estimating costs is complex because some of the least popular measures – such as bailing out the banks, for instance – end up being profitable, at least if you define bailout costs narrowly (as direct loans to banks vis a vis other programs, such as lowering interest rates to zero and holding them there for years).

In any case, a financial meltdown that cost $5 trillion to fix would probably make the recent one look like a walk in the park. Not a very nice park, but still.

Also on Fortune.com:

Follow me on Twitter @ColinCBarr.