1) Outlaw vagrancy, and arrest people for vagrancy, the crime specifically being living on the street instead of paying for their own upkeep, but the important part is...
2) They can get their freedom quickly by working some minimum wage job, provided by the city, like cleaning the highways or picking up trash, for a week. Then when they're released, they can still work that job, or they can get out of dodge.
This is a clumsy proposal and not fully thought through -- but there can be some mechanism that lets people who aren't totally deranged get themselves quickly released while directing the others to treatment.
An obvious criticism of this is, it's not hard to come up with counterfactuals. What if somebody is homeless with their family, and they get arrested for vagrancy. Now their kids are separated from them. Then what? What if they have a dog?