Yeah, he or she would keep it to himself almost undoubtedly, or if they were really moral about it they'd have to abdicate rather than taking the Coronation religious oaths.
Still, I imagine there are plenty of people in official positions who are agnostic and go through the motions of our established faith.