This hasn't been my experience at all. I live in a developing country. I've also spent significant amount of time in two cities: one with a population of 13 million and one with a population over 1 million.
In both cases, there is lots and lots of housing just like the OP describes. It works fine in a big city. It doesn't require a village.
There's an old lady who lives down the street. Her "house" is about 1 meter by 3 meters and is two levels. She sleeps upstairs and cooks downstairs.
I would bet that you tend to see a lot more theft and other crime committed against people who have flimsy, unsecured shelter in more dense populations.
In developing countries where people routinely still use a field to relieve their bowels and bladder in spite of the fact that you have city-style density levels, women get routinely raped and murdered while trying to pee or poop. This is such a widespread and common phenomenon that if you search on the term "rape, murder and lack of a toilet" you will find no shortage of articles on the subject.
So I seriously doubt it works just fine. It probably doesn't work just fine.
Of course urban shanty towns can be dangerous and have plenty of problems. So do rural villages.
But I am loathe to say "Yes" to shanty towns per se as a thing we allow in the US as official policy on city property.
But thanks for chiming in. Have an upvote.
The OP was talking about "I'm beginning to see a case for loosening some construction rules to make true low-cost housing available to more people". My actual real world experience living in a developing country that doesn't have US- or European-level building codes (which you dismissed from your comfortable arm chair in a rich country) agreed with the OP.
Building codes are nice but they are, to a large extent, a luxury good. Rich people/countries can afford them. Poor people can't. They act a barrier to entry for having a home by increasing the cost.
Take GFCI electrical outlets. A GFCI outlet costs about $10 at Walmart, whereas a non-GFCI outlet costs about $5 at Walmart. For the average American that's a trivial difference. For the lady down the street from me, that's an entire day's income. Upgrading all of the outlets in her small house would take a week's pay.
The introduction of GFCI outlet's saved ~600 lives a year in the US (population 300,000,000).
Would you give up a week's pay to avoid something that only has about a 0.002% chance of happening in your lifetime?
I guarantee you that not having GFCI outlets doesn't increase the chance of burglary or rape.....
The US has lots of room for lowering expectations and standards without moving to "shanty town" standards. For starters, we tend to expect a really large amount of space per person.
I think we very much need to pursue some means to lower our expectations in the US in some metrics. At the same time, I would like to see some safety and health standards upheld.
I did a paper once on wells causing arsenic poisoning in, I think, Bangladesh. The wells were dug by non profits from rich countries to resolve the issue of high rates of disease and death from consuming unsanitary surface waters. The wells were successful in terms of reducing death and short term acute disease. But some wells were also poisoning people.
They ultimately found that the poison wells went to a particular depth. Wells that were less deep or more deep did not contain arsenic.
Having arsenic-free wells was not a matter of cost per se. It was a matter of knowledge of the bedrock.
I'm interested in finding those answers that are the equivalent of drilling wells to the right depth so people can have disease-free water that also is not poisoned. I'm not interested in agreeing that either we can die quickly due to disease-ridden surface waters or die slowly to arsenic poisoning and, obviously, poor people would rather die slow than fast.
We tend to expect a bed for nearly every person too! Many people around the world share a single bed in a single room with no complaints.
The description above is more similar to "favela" type housing in developing countries: http://catcomm.org/wp-content/uploads/2013/11/Provid%C3%AAnc...
The closest American analog would be like a Great Depression shantytown: https://imgs.6sqft.com/wp-content/uploads/2015/11/20042951/h...
The missing middle housing, per their website, is more formal (regulated) housing with condos/duplexes/etcs, whereas OP's 'third-world' informal housing is more like "let someone build themselves something better than a tent to live in". For example, like the dense favela district next to Rio in Brasil. Above all, no city in the US would be ok with having random individuals build a favela district of unregulated/unauthorized housing. Encampments of a couple hundred people create lots of uproar; there would be a total shitstorm of lawsuits and political panic if people in the US cities lived next to "shantytowns" like those in developing countries.
If you are interested in addressing the housing aspect of this in the US, look into "Missing Middle Housing" and ways to promote more of it in your community. These are more affordable forms of housing that were common at one time in the US that have been largely zoned out of existence while we promote ever larger single-family detached homes and suburban sprawl.
That's the crux of the issue in the US. It doesn't have to be that way.