Just interjecting "but building codes!" doesn't make a lot of sense. If the codes are so strict that we can't actually build houses they are failing at their purpose.
I dunno if you've dug deeply into most building codes but they're almost always overly specific in pointless ways and in ways totally unrelated to safety. Getting an engineer to sign off on a design should be enough, especially for a freestanding (tiny)house.
OTOH, hiring an engineer to actually put their name on your home construction will almost certainly cost significantly more than the city inspection cost.
Every location (in the US) I'm aware of requires houses to be signed off on by an engineer before construction. You always have to pay for it. The issue is engineers are usually obligated to enforce code, and a lot of them try to be stamp mills -- they only want to look over and assure designs that are very similar so they don't have to think about it.
There's an unfortunate number of locations in the US where you must use wood frame for your house, or you must route your power in exactly this way, etc, even if it'd be equally safe or cheaper to do something else.
> Every location (in the US) I'm aware of requires houses to be signed off on by an engineer before construction.
This varies widely by state. In some states, it matters if you're in a municipality or if you're rural.
Where I am, in this county, I do not require a permit or inspections or anything to build a house for myself unless I'm inside a municipality. The government doesn't care until it's time to pay taxes. I may need some sort of inspection to hook up to the electric grid though, or to get water turned on. In (edit: some) other states, you can barely build a small dog house behind your house in the country without permits, inspections, engineers, surveys, and all kinds of other stuff.
I will admit that I don't know regulations outside of my area, and I'm guilty of assuming they are somewhat standardized across the US (and indeed, for some codes, internationally).
Here we just have city inspectors to check basic code compliance. They'll take a quick look at the framing, electrical, and plumbing before the sheetrock goes up, and then they come back for a walk-through before issuing the certificate of occupation. No engineers.
The biggest fees by far are the permit fees, but that's for revenue and would still exist if engineers were doing the analysis for the construction.
I dunno if you've dug deeply into most building codes but they're almost always overly specific in pointless ways and in ways totally unrelated to safety. Getting an engineer to sign off on a design should be enough, especially for a freestanding (tiny)house.