https://www.homedepot.com/p/Reliance-Controls-30-Amp-Power-I... is the first one I found on Google (4-wire for 240V center-tapped), but there are many, including a 120V version: https://www.amazon.com/Leviton-5278-CWP-Straight-Flanged-Rec...
Even these, if hardwired to the building's service, represent some risk, but the risk is to the people poking fingers into the box, which could reasonably have a locking cover on it. If that male inlet is powered only via a transfer switch or a back-fed breaker that's normally off, the risk is much, much lower than a double-male cord.
https://www.se.com/us/en/product/HOMCGK2C/load-center-access...
You need the inlet, the kit, and a correctly sized breaker that is suitable for backfeeding.
Not only is a mechanical interlock a code-compliant method to properly protect downstream line workers but it is also a simple and comprehensible component that costs very little and never breaks.
We have a whole-house generator connected to our main panel and I made a very deliberate decision not to add the complexity and fragility of an automatic transfer switch. The little metal tab will always work and nobody will ever be confused.
In particular, both can kill hapless power company employees by unexpectedly backfeeding into downed parts of the grid, and they have similar carbon monoxide/fire hazard issues.
(Not that there is anything wrong with the product; I wish they were mandatory, so they'd reliably be inspected after installation!)
Not saying it can't happen. The main one where it could is if the break is between your house and everybody else. But in the vast majority of situations you will instantly pop the dinky 15a breaker
I've done other electric work that has passed inspection.
If the outlet were required at that point in time, there wouldn't be a temptation to improperly retrofit the outlet in later.
On the other hand, generators are rapidly becoming obsolete, so this might be akin to requiring installation of upgraded coal shoots.
Also, a backflow cutoff is required by law, as are permits, inspections, etc.
San Jose has setback requirements, requires a concrete pad (for hardwired installations), and charges various fees:
https://www.sanjoseca.gov/home/showpublisheddocument?id=4499...
It wouldn't surprise me if you could get a deal on "new generator; free installation" though.
Hire an electrician to install it for you? Between markups and labor, easily several hundred bucks at the very least. A thousand is entirely plausible.
Ignorance is expensive, knowing how things like electricity and plumbing work will save you money and help make life more fulfilling.
If you get lucky and find an inexpensive electrician AND the inlet you want to install is located very close to the panel (minimal drilling, short wire, etc.), you can probably get it done for less than $1000, but probably not a whole lot less.
I'm assuming that is the alternative due to there not being a proper way to accomplish this goal that does not cost thousands of dollars.