I hope that you are aware that many people who have mental illness do not realise that they are mentally ill until it causes some sort of crisis in their lives. The case in point being depression.
If you do not know that you are ill, how can you know that you need treatment?
Likewise if you do find out or discover that you are ill and choose not to have treatment, how is that any different to someone who has a physical ailment deciding to put up with it and not see a doctor.
If you compel people to get well then they cannot possibly be free. Likewise those people doing the compelling are also not free, both sides of the coin lose in this case. To compel treatment means that someone else is obliged to force these people to ‘get well.’
The more laws that exist the more responsibilities we all have in maintaining those laws, thus over time society becomes less and less free.
I would also further add, that most people who are mentally ill are not a danger to themselves or the public and thus are not the implied threat that this question seems to suggest.