He does mean harm and he's not your friend. Disrespect is contagious. If you want to be respected when you speak, he's harming you by telling you not to speak. If you want to be seen as well-mannered and socially adept, he's harming you by doing mocking screeches. Nobody will ever see you as some wimp who can't take a joke if you stand up for yourself.
You can try reasoning with him. You can try confronting him one on one and being kind. Yet I find rarely the type of people who say "can't you take an edgy joke" are reasonable. They usually just say something about how they make fun of everybody they aren't being offensive.
If you can resolve this situation passively by not associating with this person, consider doing so. Tell the teacher you don't want to be grouped with him. Don't hang out with the people he hangs out with. Don't go to his classes or his school.
In my experience though the only real option is a counterattack. If you're more popular then him, socially isolate him. If you're sharper than him, backtalk him. If you're stronger than him, wrestle him to the ground. If the teacher hates him, rat him out. If he has an embarrassing secret, reveal it. Go to war and make as much trouble for him as possible. The point isn't stopping him... it's sending a message.