About 10 years ago, we installed a natural gas generator after a massive early-season New England snowstorm left us without power for 8 days. That was an unusual storm; we probably average less than 10 hours/yr of outage. The generator was around $5500 all in, ordered and installed through Home Depot. Our annual electricity consumption is around 20,000 kWh. The generator would handle almost all of the house power other than central air conditioning. Here in New England, you can die from lack of heat but not from lack of AC. We already had natural gas for heating. Cost for gas and maintenance is less than $500/yr. System automatically cuts over when there is 10 seconds or so of power loss. It is a bit noisy, but it hides nicely behind bushes.
We are putting in Tesla solar now (16.32 MW, 48 panels, $32k pre 26% tax credit). Tesla recommended 4 Powerwalls, which would add an additional $16k. I decided to skip the Powerwalls and keep the gas generator and the $16k. The gas generator was relatively inexpensive and could run for days if needed.