You can also build affordable housing directly. We powered the post war period with a huge supply of starter homes.
Other countries have also directly attacked homelessness by simply building enough public housing such that anyone who wants a roof over their head can have one regardless of their ability to pay for it.
We don't mandate car manufacturers to build affordable cars (although they are free to). People with lower income rely (or should rely) on the used car market. Those cars are naturally affordable.
Car manufacturers build high margin cars for people with the money, people with the money leave a trail of used cars in their wake, people without money for a new car buy those used ones.
That's a totally sensible and functional market. No mandates or compelled charity needed.
You don't have to mandate anything of landlords. Public housing is a thing.
There are very successful examples.
And on the car side, there's plenty of very cheap new options. I can literally lease a new EV for ~$100/month. Who's voluntarily building starter homes anymore? We built fleets of those in the 50s, without the song and dance that they were luxury and required time to turn into starter homes. If anything in a lot of places, the starter homes of the 50s are the relatively expensive housing of today.
We don't have "used apartments". Your metaphor falls apart here. And land is limited and government controlled. So GM can't just roll up and produce new houses out of an assembly line.
Land is limited, meanwhile we've built cars for a century and maybe the last 40 yeses worth of cars are street compliant. The only thing comoarable for cars is showing what abundance can do for a market. Less people care about a 2026 Camaro being affordable if you can buy a used '05 camaro for $3000 (which is probably still and absurd price, but hey. That's less than two months of rent in CA)
Other countries have also directly attacked homelessness by simply building enough public housing such that anyone who wants a roof over their head can have one regardless of their ability to pay for it.