The thing is that there is a fine line between 'mean', 'assertive', and 'aggressive'. People in general can be very mean. People say: "I am the way I am [mean] because the world is mean to me" and I understand where they're coming from , but I don't agree that it's a valid reason. The way I see it - if someone is being mean and you be mean back, then you lower yourself down to their level. You become no better than they are. You can't always control who treats you poorly, but can control how you handle and react to poor treatment. Part of that is brushing off what they say and responding with good grace. There's a saying: 'fight fire with fire.' But can you really extinguish a fire with more fire and more gasoline (namely, reciprocating meanness)? No. Same concept. You can't make a person want to stop being mean if you be mean in return.
Sometimes people are mean because they want retaliation, or they want to be entertained by the anger of the person they are being mean to. It's a power statement. In which case, one approach could be to act like it doesn't bother you. A bothersome person who seeks to bother won't bother with a person who can't be bothered. It's not worth their time or effort. That's not to say that power is the motive of every person.
At the same time, being a pushover and never standing up for oneself - that's no good either. So if you can find that happy-medium where you are respectful while being exceptionally clear that you don't want to be bothered or bullied or verbally attacked, etc., then people will be more likely to respect you. If you can sit down with whoever is being mean, and discuss the situation in a calm and civil manner, maybe you can talk the whole thing out and come to an understanding. Meanness often comes from a place of anger. So if you can ask them - and yourself - logical questions regarding the reason for meanness, then theoretically the meanness should come to a halt and the discussion should stay less heated.
It can be really confusing why people are mean for no reason. And it's hard to go home at the end of the day not feeling down when someone has said some really harsh things. It's too easy to see things as black and white: either 'I'm feeling down' or 'so-and-so needs to get a taste of their own medicine'. But in truth, it doesn't have to be like that. If you hold onto resentment and/or believe the nasty things people say, you're only going to be hurting yourself and weighing yourself down. Easier said than done. It's really hard.
The first step to do when someone is being mean: 1) stop. Control your emotions. Is there a reason they are being mean? If there is, how can you help remove the cause of the issue? The way I see it - any problem can be solved. If they don't understand your autism, or if they don't even know you have it, then perhaps you can relay facts to them about it. If they don't listen, at least you did the best you could, and the blame cannot go to you.