Well, I think I can now partially answer this question myself:
I have now made an attempt to load Europe without making changes to the PostgreSQL settings as listed above. Instead of running into an issue with PostgreSQL itself, osm2pgsql nicely reported to little “cache” for storing the nodes in memory with the “-C 4000” (4000MB) cache setting I set on the command line (don’t confuse this 4000MB with the PostgreSQL shared_buffers listed above, this is a setting of osm2pgsql itself).
So I raised cache to -C 20000 as second attempt, which exceeds the RAM. osm2pgsql again intervened and correctly reported I didn’t have the RAM for this (besides about 11GB RAM for the virtual machine, only 8GB swap was available, the latter probably also ignored by osm2pgsql).
So the third attempt was with -C 8000, and that again bailed out after loading about 650M nodes. Since planet is already well over 4 billion nodes, and Europe about half the PBF size of planet, I guess Europe is at least 2 billion nodes, so I fall short with RAM available for cache by at least 16 GB on my machine, assuming I managed to load about a third of the Europe nodes.
So now, instead of attempting to load this entirely in-memory, I selected the --flat-nodes option for my fourth attempt, which should store the nodes on disk instead of loading them in memory. This is still running, I will report back whenever it fails or finishes, but it looks promising, as it already passed the 650M nodes loaded where the previous attempt failed that didn’t use --flat-nodes.
It also seems that the speed of the loading of the nodes is marginally faster than without --flat-nodes, something like 700k nodes/s versus 550-600k nodes/s.