That would be outside of legal framework because asylums were effectively outlawed. My solution is within legal framework.
The law is a human construct. Involuntary commitment used to be legal. Just make it legal again. Or, make it easier to obtain the orders. If humans changed the legal framework once, we can certainly change it back to what is proven to work.
The supposedly inhumane treatment in asylums was nowhere near as bad as the treatment the crazies get on the street.