About 2 decades ago I did some serious research into using a cistern as a heat battery. Heat it by vacuum heat tubes or solar PV. At that time the solar panel technology losses made heat tubes the winner by a mile for just pure capture the energy and heat the water perspective. You need to perform some heat loss calculations of your cistern and appropriate insulation just to get a sense of what losses you will incur daily throughout the year but lots of online calculators will give you a rough estimate.
In my case I was considering using a glycol mix pumped to underfloor heating so no worries about freezing, bacteria etc.
But like most things in life the true issues arose not from the basic calculations of energy captured versus energy lost to heat lost, pumping electricity losses etc. They all made good sense, the heat gained versus the cost of running, build, glycol etc. amortized over 5 years was break even and beyond that was win win. In my use case.
Where it all got gnarly was building something functional. Heat exchangers (radiators repurposed or copper coils etc) dissimilar metals, electrolysis, sizing the piping to reduce pumping losses, sealing the cistern so reduce oxygen transfer, acidification of the glycol mix due to aging etc. When all was said and done it was cheaper and more efficient to use straight vacuum heat tubes to heat the glycol mix for the underfloor heating using a standard pressurized sealed hydroponic underfloor heating circuit. Use the slab thermal mass as a "battery" and although it wouldn't actually keep the building warm throughout the night is was good enough. Cloudy days and snow were still an issue so backup heat was required.
Anyway, not what you were exactly planning but just my 2 cents, its not the math's that will stop you it's the real world issues. And remember this was 20 odd years ago so the options today may be way better for off the shelf solutions but DIY'ing it will give you headaches.
So work out your volume, work out your surface area, run it through some calculators to figure out your min power input to keep water above freezing, now figure out how much above freezing it needs to be to be above freezing after 5 days of no power. Look at your unused PV and see if that aligns and if it does then go to the next step. A heating element doesn't care about DC vs AC. But honestly the conversion of irradiance to heat is better served by vacuum tube heaters than PV IMHO.
something like
https://www.siliconsolar.com/product/20-vacuum-direct-flow-solar-collector/ not a recommendation, first one I saw in search.