The regulations that weren't written in blood generally fall into the "zoning" discussion. Stuff like parking minimums, set-backs, etc.
The only thing I can think of off the top of my head that straddles the line is the requirement to have two staircases in low-rise apartment buildings. This is a uniquely (US)American code. Nominally to manage fire risk. But much of Europe and Canada manage with one staircase and improvements in building materials that reduce the risk of a fire starting before fast egress is necessary.
I don't know about most, but some were written to make certain types of cheap dwellings illegal because society didn't approve of the people living in them like single-room occupancy dwellings. They're perfectly safe, but lawmakers didn't like the poor people living in them.
Some are also out of date with other solves for the same problem, like NYC's rules around needing 2 staircases for buildings over a certain size. Pretty much everyone agrees its no longer necessary.
In every single place where housing is "unaffordable", a literal empty plot of land is also unaffordable. It has very little to do with what it costs to build a tiny shed. This is also why "tiny houses" and "3D printed houses" are nonsense and have done nothing to improve the situation.
The problem has nothing to do with the fact that the outlet next to the bathroom sink requires a GFCI device, or that you need a separate flue for your pellet stove, and everything to do with a small plot of land being a couple hundred thousand dollars despite literally being a forest.
The homeless aren't being kicked out/arrested because their tents aren't up to code, they are being kicked out/arrested because they do not have a plot of land they are legally allowed to pitch that tent on.