Indiana has statutes that allow for voluntary and involuntary civil commitment...
https://law.justia.com/codes/indiana/2011/title12/article26/chapter7/
Involuntary civil commitment that is pursued outside of the criminal justice system is a surprisingly expensive endeavor. It’s only going to be done by families with some means because lawyer fees pile up quickly. It’s going to be more than a divorce; think hundreds of billable hours.
Now, if a person gets into trouble with the law, then the city/state can seek it as an alternative to incarceration.
They could probably find something in all of us if they wanted to. I’d like to see how this is executed.