[Sigh] Please read the rest of the thread. My goal would not be to punish, but to correct. The difference between me and most of the others here is who's concerns take priority. Others seem to be primarily concerned with the concerns of the perpetrator, whereas my concern is for the victims.Depending on the cause that could be very cruel. That one's first impulse is to punish even before understanding is disgusting/unacceptable in a individual that has authority over others.
Also, while I am aware that there can be medical reasons for an odor, the description in the OP (wearing the same clothes over and over without washing them) precludes them from being a factor here and also implies that shaming may be necessary.
Indeed, in another way, you guys are looking at the "shaming" issue backwards: the students' only real power here is shame. The teacher is the only one who is guaranteed capable of dealing with the situation without shaming him in front of his peers.