Qadi ^Iyad relayed the scholarly consensus that the one who curses Allah apostatizes even if he or she was angry, joking or did not feel delighted by the utterance.
Suratut-Tawbah, Ayat 65, 66 mean, “If you question those who have blasphemed, they will say,' we were only babbling and kidding. Say to them, ‘Do you jest about Allah, His Verses and His Messenger? Make no excuses, for you have blasphemed after having been Muslim.
The Messenger of Allah, sallallahu ^alayhi wa sallam, said, “A slave may utter a word which he thinks harmless, that results in his falling the depth of seventy years into Hellfire.” (Related by at-Tirmidhiyy). This depth is the bottom of hellfire and a place occupied by blasphemers only.