Oh not at all. One of the first teaching of Islam is "There is no compulsion in religion".
It’s a commitment you chose to abide by, between you and God, you either hold to it or don’t.
The state has nothing to do with it, and mosques/sheikhs don’t hold any power. No matter what the media shows you.
Just like how one might not pray, or not fast, they can also not pay tax. 🤷🏻♂️
There is no shunning or excommunication in islam. I understand why one would think that, what you see from “islamic” countries are not always in 100% in accordance with Islam. Many of them have turned into theocratic systems as you mentioned.