Its theoretical money, not actual money. A potential future cost. It only becomes actual money if there is a default.
And in most default scenarios, the government wouldn't have to pay the full $40 billion. Just the shortfall between the foreclosure sale price and the remaining loan amount.
> So ask yourself why will commercial funders not give money to the builds, while they are perfectly happy for solar/wind?
First, Solar/wind projects are typically smaller. Less risky to do hundreds or thousands of small projects, spread out over country (or world). The chance of all the projects defaulting at once are small.
Second, one of the biggest risk to nuclear projects are government related. The risk that they might introduce expensive new regulations. Or that the general population (who are typically anti-nuclear) might vote a new anti-nuclear government into power. By having the current government guarantee the loans, future governments will be motivated to not mess with them.
Third, you can't always trust commercial funders to do what's best for the nation, especially from a national security perspective. They might (for example in Germany) decide to rely on cheap natural gas imports from Russia as the primary source of energy, assuming that Russia will always be a stable source of energy forever, and would never start randomly invading it's neighbors.
Never the less, the financing strategy works. At least in Scandinavia. Defaulting happens rarely enough to not be an issue.
Well-run governments can borrow money much cheaper than private actors. Lower interest rates means a higher chance of success for a long-running project.
Loan guarantees are actual money, especially if the builder defaults.
> The main purpose of both guarantees is to make it much easier for nuclear reactors to get commercial funding from private banks.
So ask yourself why will commercial funders not give money to the builds, while they are perfectly happy for solar/wind?