For whatever reason, an ex-Muslim might desire to be legally recognized as a non-Muslim under sharia. A question on Quora asks about a specific case of this, where a Muslim woman wants to formally leave Islam to marry a non-Muslim man. In her specific case, an (unreferenced) answer by Jim Duley says:
Converting from Islam is not "impossible" but is not easy in Malaysia. If your wife were a Malay, she would have to get permission to convert from an Islamic court.
This suggests there is a formal process through an Islamic court in Malaysia. I want to know if this is correct, and if it applies more generally.
Question: Is there a formal process to legally leave Islam?
It seems like there should be a process, otherwise it could be difficult determining how sharia applies in some cases (e.g. inheritance, marriage). Note: while some countries have the death penalty for apostasy, other countries do not; see Apostasy in Islam, Wikipedia.
(...and before you ask, no I'm not leaving Islam.)
This question (Is there a formal process to legally leave Islam?) currently has two votes as a duplicate of Is punishment for leaving Islam death?. However, I don't see and mention of the (non-)existence of a formal process [whether or not it results in the death penalty (which is debated in the linked question)].