That's why I am also surprised that you so easily get off the hook. In Germany, a pure legal divorce would not help you.
Correct me if I'm wrong, but from what I understand in Germany health care for an elderly person would not bankrupt their spouse.
Well, yes and no.
First of all, in Germany, we have a compulsory long-term care insurance. So every one is forced to prepare for long-term care in addition to the compulsory health insurance.
This insurance should, in theory, make sure, that an elderly person would not bankrupt their spouse.
But, a nursing home space for someone with Pflegestufe (level of care needed) 3 will cost roughly 3165€ per month while the long-term care insurance maxes out at 2005€ per month. The difference has to be paid (ultimately) by the care receiver or his relatives.
First the spouse has to pay.
If at the time of the divorce the need for care is known, the obligation to support persists. Even if the illness is not known, there is something called "Unterhalt in Not" (support in need/misery) what could lead to an obligation to support the ex, even years after the divorce. (Unterhalt in Not can be excluded during the divorce process, but you need to know about it to exclude it...)
If the spouse can't pay (or when the care has consumed all available resources), the children have to pay for the care for their parents. This obligation persists, even if you hate your parents and haven't spoken to them for 30 years.
Of course, there are limits. E.g, as son or daughter you don't have to pay if your monthly disposable income is below 1800€ (3420 if married).
But this protected income can go down to 770€ per month, if the care receiver is your spouse.
So an elderly person in need for care could bankrupt their spouse.
TLDR;
In Germany we are forced to prepare for long-term care. The obligation to support relatives is broad and hard to dodge. Relatives who need care can cost you thousands of Euro per year. If it's your spouse, it can bankrupt you.