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.
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.