You’d have to ask a Rav, but I think there’s a difference between learning in an unclean place without actually speaking out the words and saying them while davening. I guess the question of tznius for someone “shukelling” and attracting attention to themselves is for a different forum 😉