Moving all the functions to a separate file and returning them would work, but if you want to go more complicated, I'd recommend adding a remote interface (wiki page about that here) instead of somehow passing all the parameters through the effect_id.
Oh yeah, forgot about that... good idea!
As much as I'd like to see nukes in the Gt range, what you're describing is most likely not possible, because on every new chunk loaded you'd have to:
1. Calculate how far away it is from the ground zero of EVERY powerful bomb
2. Check how many (if any) of the chunk's tiles are inside a fireball of any bomb and vaporize accordingly
3. Check how much of the chunk should be a crater and replace all the tiles
4. Somehow check how much destruction would've been done by the blast and damage stuff accordingly
and so on, until all of the nuke's effects are accounted for.
It would be hard to code in and even if it worked, generating any new chunks would freeze the game for a while.
The hope is that there are never that many entities in a newly generated chunk, so while it may slow the game somewhat, it shouldn't be that bad.
Also the 'powerful bombs' would only include 100kt and above, and anyone who detonates loads of those would get what they deserve, I will also apply a range limit to each bomb, so as long as the chunk is more that a certain distance away from the bomb, the script just skips it - this adds some overhead to every chunk, but not that much.
Besides this, the blast and thermal are actually pretty quick to do on a small number of entities, particularly as I can skip making it look like they just died, most of the problem of a really huge nuke is that all this is happening at once, which creates huge memory usage, reducing the CPU's ability to cache stuff, etc. and this is all times several hundred chunks, and it has to load those chunks. Hopefully, when working on a single chunk, I can just get every entity in that chunk (realistically no more than 2000), and go from there.
My main concern is honestly that it will introduce weird desync issues, as the game would then depend on chunk load order, which it really shouldn't, so I'll have to use random number generators from the chunk position, not the global one.
This whole thing will also introduce some problems with mod compatibility, but that is kind of to be expected.
For bigger nukes, I think that the best thing you could do it spread all of the calculations over a several seconds (or minutes in case of really big bombs) instead of freezing the game completely.
I have now time-blurred the thermal calculations which were a big part of the huge super-freeze, most of the rest of the super-freeze is from the map load, which shouldn't need doing now.