I think it’s a red herring in areas with expensive housing. If you could save a bit of money with cheaper building codes, the land cost would increase by the same amount, because land is capturing all the surplus.
Land only captures all the surplus when construction that increases density is prohibited. What people are really paying for living space, not dirt. A thousand square feet in a ten story building is pretty much just as good as a thousand square feet in a single story building, but the ten story building has ten times as much of it, so at scale more supply lowers the price.
There is also demand for "smallest available unit of housing" which naturally costs more if it's required by law to be larger.