Maybe there's a way to house them in some kind of voluntary mental facility only for non-dangerous mentally ill people. They can come and go during the day. But at least they have a roof over their heads, someone to look after them, provide clean clothes, etc.
Feels like someone must have already tried this and none of the mentally ill homeless were interested.