>As of 2014, there were eight Muslim-majority countries where apostasy from Islam was punishable by death, and another thirteen where there were penal or civil penalties such as jail, fines or loss of child custody.
I'd say at least in those eight death penalty countries, you practically are not allowed to leave. And if the state letting you live but is taking away your children from you, you'll too think twice about leaving, too...
In some regions, while apostasy is not official punished by law, people will still punish it extra-legally e.g. by committing "honor killings".
Of course, this does not reflect all of Islam/all Muslims, and what people think about how apostates should be dealt with varies a lot regionally.
If it even is legally (under religious laws) possible to leave the religion is a contested issue between theological scholars, however the bulk of theological scholars seem to consider it an absolute crime against God, but may disagree on whether it's up to people to punish the crime, or punishment be left to God.
But even in Western countries there can be significant support within Muslim communities to harshly punish apostates.
> A similar survey of the Muslim population in the United Kingdom, in 2007, found nearly a third of 16 to 24-year-old faithful believed that Muslims who convert to another religion should be executed, while less than a fifth of those over 55 believed the same. [0]
That said, other religions, including an in particular Christianity, historically haven't been nice to apostates, either.
[0] https://www.theguardian.com/uk/2007/jan/29/thinktanks.religi...
> As of 2014, there were eight Muslim-majority countries where apostasy from Islam was punishable by death,[17][18][19] and another thirteen where there were penal or civil penalties such as jail, fines or loss of child custody.