I've found out something interesting, wells add +3 to the maximum houses stat in a city, which is weird but it is the only thing I've found that increases the maximum number of houses
So if you don't want unlimitedhouses in the debug menu but still want some dense looking villages, place down wells I guess... It's atleast an alternative to the laggy unlimitedhouses option, too bad units barely make them naturally, usually only 1 well