If it was unintentional then it will not make the person Kafir. However, it is extremely sinful to mention Shirk or Kufr in a positive way.
وَقَدْ نَزَّلَ عَلَيْكُمْ فِي الْكِتَابِ أَنْ إِذَا سَمِعْتُمْ آيَاتِ اللَّهِ يُكْفَرُ بِهَا وَيُسْتَهْزَأُ بِهَا فَلَا تَقْعُدُوا مَعَهُمْ حَتَّى يَخُوضُوا فِي حَدِيثٍ غَيْرِهِ إِنَّكُمْ إِذًا مِثْلُهُمْ إِنَّ اللَّهَ جَامِعُ الْمُنَافِقِينَ وَالْكَافِرِينَ فِي جَهَنَّمَ جَمِيعًا
And He has already revealed to you in the Book that when you hear Allah’s revelations being rejected and mocked, then do not sit with such people until they change the subject of their conversation. Otherwise you will be like them (in sin). Indeed Allah is going to gather the hypocrites and the unbelievers all together in hell. (Surah al-Nisa, 140).
In the Holy verse above we are prohibited from being in the presence of Kufr and blasphemy, so to sing it would be worse. However, as Sunni Muslims we never rush to Takfeer (declaring a Muslim Kafir), rather we must warn Muslims who do such things about the seriousness and sinfulness of what they are doing, without declaring them Kafir.
وعَلى هَذَا لَا يجوز نِسْبَة الْأَفْعَال الممدوحة والمذمومة للدهر حَقِيقَة، فَمن اعْتقد ذَلِك فَلَا شكّ فِي كفره، وَأما من يجْرِي على لِسَانه من غير اعْتِمَاد صِحَّته فَلَيْسَ بِكَافِر وَلكنه تشبه بِأَهْل الْكفْر وارتكب مَا نَهَاهُ عَنهُ الشَّارِع فليتب وليستغفر. (عمدة القاري شرح صحيح البخاري)
It is not permitted to attribute positive or negative occurrences to time, in reality (meaning believing it to be reality). Whoever believes that (time causes good and bad) is Kafir without doubt. As for the one who mentions it on his tongue heedlessly, without believing it to be true, he is not Kafir. However, he has resembled people of Kufr and has committed that which the Shariah has prohibited, so he must repent and seek forgiveness. (Imam Badr al-Din al-Ayni, Umdatu al-Qari).
ولو جرى على لسأنه كلمة كفر لا يكفر بلا خلاف (فتاوى قاضيخان)
And if he thoughtlessly speaks a word of Kufr, then he does not become Kafir. There is no difference of opinion on this issue. (Fataawa Qadi Khan).
We see from the Hanafi Nusoos (texts) above that thoughtlessly or heedlessly repeating or mentioning words of Kufr does not make one a Kafir, unless he agrees with them. However, it is extremely sinful, and must be avoided. A person who has done this in the past must repent and seek forgiveness from Allah (Most High).
And Allah (Most High) Knows Best.
– Answered by Shaykh Noorud-deen (04.05.2021)
See also (video):