I'm all for making fun of euro salary but please $40k is lower than everything I heard of except perhaps in low ranked Spanish places. Replace $ by € or £ and think outside of the 20 best European places.German salaries are public. Postdoc gets around 3k eur a month net.
It gets a little more if you are married and/or have children, health care and unemployment insurance are completely covered like this, and kindergarden, school and university are free in Germany, there are very few homeless people elsewhere than in Berlin, you can walk in nearly all parks at night without getting robbed or killed (women should stay in lighted areas though as rape sadly does happen as probably next to anywhere in the world). It is similar in many European countries. Just comparing salaries is not reasonable.
And you can hardly live with a postdoc salary in San Francisco. You should compare AP salaries. Difference to North America is there are less tenure track positions in Europe.