That is why I think the energy would be best used for water security somehow, but I don't know how.
So what about using surplus electricity to extract drinkable water from the air?
https://www.amazon.com/AERstream-Pro-Atmospheric-Water-Generator/dp/B0G1TGMSGDAny cheap dehumidifier does that, but the water they produce is not regarded as safe to drink as they are not designed with avoiding contamination in mind (you probably could, with additional filtering). But I use water from mine to water the plants, and of course it would be fine for other non-drinking applications.
The "water generator" specs say it uses 200W, but I don't know what the real-world daily water production will be.
I think roughly speaking my dehumidifier (Panasonic F-YCL27N) fills the 5 litre tank about every 2kWh of electricity used (8 hours of continuous running at 250W), so an actual 15 litres per day. That's while operating in a room between 21º C and 24º C at RH of 45%-55% (it has an automatic mode that cycles on and off at around those limits). The headline spec is "up to" 27 litres/day.
So maybe 10 litres per day is actually realistic from the purpose-made water generator, using 4.8kWh of electricity
AC power is easy and safe to manage with a "portable battery generator". I have a Pecron E3600LFP which has 2400W of solar input (I actually have 2640W of panels on mine), a 3kWh internal battery, and 3600W 240V AC output. Cost of the US model is currently $1049, but as usual things are a bit more expensive here in New Zealand or in Europe.