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.
There is also demand for "smallest available unit of housing" which naturally costs more if it's required by law to be larger.