I'm not an EE but I can envision a kludge project for someone with more money than brains (and you would still need a lot of both).
Plug in an AC to DC power transformer to the generator capable of simulating the power output of solar panels and handling the maximum output of the generator.
Connect the transformer output to a solar inverter that "clips" at the maximum generator output.
Connect the inverter output to the Gateway just like any other "solar" generation system.
Not elegant or efficient but it might work. But be prepared to let the magic smoke out of something including the powerwalls, solar, or house.
The more I explore battery backup with DIY Powerwall approaches, the more it seems that having a gas/propane generator in the kit is very desirable for multi-day backup, whether the generator is the primary power source for the batteries, or the secondary/supplement to solar panels. The DIY hybrid/off-gridders are increasingly migrating towards this direction, the battery station / "solar generator" folks (e.g. EcoFlow, Anker) are starting to explore it.
The end-state of this thread was that the most popular grid-tie battery solution by far, Tesla Powerwall, does not support generator input, even clean pure sine-wave generators, so the closest compromise is basically a parallel-hybrid approach, a transfer switch to allow either running on solar/Powerall, or gas generator, but not in tandem in any way. Or Enphase supports off-the-shelf generators, but locked into proprietary ecosystem for the solar, battery and gateway portions.
But RKCRLR's statement above is exactly where the diy/hybrid/off-grid crowd has been migrating. Yes, as miimura pointed out, many hybrid inverters already have an AC generator input to make things easy off-grid. But many inverters died because they disliked the somewhat dirty power from gas generators, esp modified sine-wave ones. The key realization of the other communities is - we already have a solar inverter, who said the DC input side MUST come from solar panels? As long as the MPPT control algorithm on the DC "solar" input doesn't get confused, folks are sending in generator via AC-to-DC conversion into the solar inverter DC inputs, while conditioning and cleaning up the dirty generator power to protect their hybrid inverters at the same time. It's not really even the realm of experimentation at this point - you've got 120/240V switched-mode power supplies (SMPS) that output at 48-110V DC, or the latest and greatest, Chargeverters at 60V up to 5000W, people are doing this every day.
So back to this thread - sure, Tesla Powerwall doesn't support generators when off-grid, but they certainly support grid-tie solar inverters, specifically they support MULTIPLE grid-tie solar inverters, whether it is folks with multiple solar/string inverters, or dozens of micro-inverters, all while off-grid. So why NOT wire up another grid-tie solar inverter, totally permitted, but without solar panels?
A key insight is that this is more of a series-hybrid approach, with gas generator feeding/supplementing Powerwall batteries, you don't really need or want a large generator, nor a large inverter, like you would with your rooftop solar or a parallel-backup. You probably want something smaller, running at a higher-efficiency 50-80% load of the generator, that just needs to keep up with the AVERAGE not peak loads on the Powerwalls.
So looking at one of the smaller grid-tie inverters, a $500 3K Growatt, you could do up to 3000W at 93% AC-DC efficiency with:
-$500 3500W 240V modifed sine-wave generator AC > $400 Chargeverter > 3K Growatt > home microgrid > Powerwall
The one mismatch is the Chargeverter (along with most available rectifiers) maxes out around 60V, and the 3K Growatt has min input voltage is around 65-80V. Plus with a 14.3A limit, operating the Growatt in the low voltage range maxes out around 1100W output, though no reason you can't parallel 2 or 3 units. Or completely available off-the shelf, but perhaps only 80% efficiency
3500W generator > 2x SMPS 80-110V DC out (1500W max) > 3K Growatt > home microgrid > Powerwall
Or another approach would be multiple micro-inverters:
3500W generator > $400 Chargeverter 48-60V output > 4-6x microinverters > home microgrid > Powerwall
I don't think there's any "magic smoke" concerns with any of these, just like for the hybrid/off-grid crowd, it's just discovering which grid-tie string and micro-inverters MPPT inputs don't get confused when the DC input doesn't behave like a solar panel IV curve, but rather a constant voltage. And the ones that don't work won't get fried, they just may put out reduced or no power as the MPPT "hunts". We're talking about UL listed solar inverters, installed in intended grid-tie manner, so not like you have to do a run-around of permitting, I would think.
The costs of a series-hybrid kit are far less than installing a whole-home Generac for the parallel-hybrid approach, but even if comparing with a generator interlock and cheap generator with the parallel approach, the fuel-to-AC efficiency of the series-hybrid approach is going to be way, way higher than running the larger generator in parallel. Not to mention the convenience, you wouldn't even need to do any manual transfer switching, you could even just remote start/stop the small portable generator anytime you wanted to top up the Powerwalls when solar falls short, your additional grid-tie "solar" inverter would just automatically feed right into your micro-grid....