it’s not voluntary. You even speak about leaving and you die.
That is why any person who is Muslim who decides to leave Islam has to do it in secret for safety sake.
Islam is far harsher on apostates (officially speaking, if the Koran is really a guide for them, which is no easy thing to determine. It IS a guide when it suits them, and not...when it doesn’t.) than it is on “unbelievers”, Christians, or even Jews, hard as that is to believe.