My husband tried this approach with a Nephew who thought cussing was so cool. He took our son and the Nephew on a camping trip and told them they could do all the swearing and dirty talk they wanted. After an hour or so it they kind of tired of it..like if it's not forbidden they don't want to do it. Of course my husband said they were not allowed to use that language again but I think it did kinda take the fun out of it. Not sure how it would work in a classroom setting.
We did the same thing with our oldest. He was about 3 when he started cussing (yes - we were bad examples at the time). So we didn't make a huge deal out of it and told him that if he wanted to talk like that he had to do it in his bedroom. He got bored and that was that!