I'll note that 40kW is only about 53HP, not a very large engine for a car. It's approximately the power of two commercial lawn mowers.
I have a home lab, full rack. Around 4kw including a dedicated A/C.
I have excess power and will run an extension cord to neighbors if needed.
I’d also want capacity to charge an EV should I get one.
Price between 22kw and 40kw was negligible relative to total project cost. The only downside is I have to turn on everything in the house twice a year to exercise it and avoid wet stacking.
Final note is that in order to use an automatic transfer switch you must have sufficient capacity for connected loads. A smaller generator would have forced me to install a second sub panel for loads I want to run during an emergency.