It is disliked for a Muslim to mention Allah while in the toilet, but he/she may recall the supplication in his/her head without uttering it; that is in case he/she had forgotten mentioning it before entering the toilet.