I've just lost at least a cup full of brain cells trying to track down the crash, to no avail so far. The worst part of it is that it seems to be non-deterministic, i.e. if I load a save and play one turn, then reveal the whole map, sometimes it crashes and sometimes it doesn't. How am I supposed to identify what's wrong then?
This, unfortunately, points to the conclusion that the state of the game is not the sole reason for crash and it might be a memory issue.
I think I'll seek the help of other modders in the general modding forum to get ideas on how to verify that.