If I'm at home, I shut down my inverter if there is a lot of lightning around. I have breakers at the windmill, solar panels, inverter, 48v battery bank, mains switch, etc. So everything is pretty much isolated from each other. My inverter is a 6kw Latronics, and expensive, so I play it safe. The main breakers give over an inch of gap across the contacts, and there are lots of earthed spark gaps.
I do have a backup system, separate 12v battery bank with its own solar panels and a 300watt inverter that can run the water pressure pump, a couple of lights and a radio. I leave this up during storms so I'm not sitting in the dark, have water and some entertainment. If it gets zapped I have spares.
The way I see it, living off grid has advantages, like no power bills, but I need to take responsibility, which means running from the house to the shed to shut down the inverter in the middle of the night during a storm.
Glenn