All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
According to the view that it is an obligation on a non-Muslim to perform Ghusl if he embraced Islam, then if he performs Ghusl once while intending to embrace Islam and at the same time he intends to purify himself from Janaabah (major ritual defilement), then this is enough for both, i.e. one Ghusl is sufficient for both matters.
Ibn Qudaamah said: “Chapter: If there are two things that require Ghusl, like menses and Janaabah, or the meeting of the male and female private parts and ejaculation, and one intends purity from both of them by performing one Ghusl, then it is sufficient for both. This is the opinion of most scholars; among whom are ‘Ataa’, Abu Az-Zinaad, Rabee’ah, Maalik, Ash-Shaafi'i, Is-haaq, and the scholars of the Hanafi School….”
Apostasy according to the Hanbali School of jurisprudence is an act that requires Ghusl, the evidence is the saying of Ibn ‘Abbaas: “There are two acts [that require Ghusl]; the act of the tongue, and the act of the private parts, and the more serious one is the act of the tongue (i.e. pronouncing something that takes one out of the fold of Islam).” [Al-Mughni]
So, whoever performs Ghusl once for all those acts that require Ghusl, then that is sufficient as we have already clarified.
In fact, if one intends to perform Ghusl for embracing Islam, it is enough and he is not obliged to intend to perform Ghusl from ritual defilement which had happened when he was still a non-Muslim [i.e. before he embraced Islam].
Ibn Qudaamah said: “If a non-Muslim was in a state of sexual defilement and then he became a Muslim, he is not obliged to perform Ghusl from ritual defilement, whether or not he performed Ghusl while he was still a disbeliever; this is the view of those who believe that it is an obligation to perform Ghusl when embracing Islam, and the view of Abu Haneefah.”
Besides, it should be mentioned that the place of the intention is the heart and not the tongue, so he should intend in his heart that this Ghusl is for becoming a Muslim and he does not utter this with his tongue as we have clarified in Fatwa 116266.
Finally, we have sensed from your question, dear brother, that you are affected with some sort of Waswasah (obsessive whispers) regarding going out of the fold of Islam. So, please know that if anyone doubts that he had committed an act of disbelief and he performed Ghusl thinking that he became a non-Muslim and he intends with such Ghusl to re-embrace Islam and to remove ritual impurity, then his state of ritual impurity is removed.
Allaah knows best.