That's what the ignore function is for. Use it liberally. My ignore list in hon is well over 150 people. During my dota1 days that ignore lost probably stretched to +500. Dota2 to its credit seems to have significantly less morons than its forebears but they're still there.

Just put them on ignore the moment they have you thinking or playing unlike your usual self. I've been guilty of losing it on occasion. I remember this one game with magmus (sand king) who was truly awful. As in, genuinely garbage. I utterly lost it but in hindsight that was wrong and I should have just put him on ignore and continued my own game. Flaming him affected my game too and chances are he was just having a terrible game; I've had plenty of shit games myself.

For the most part I deal with Luna style players by flat out ignoring them and just playing my game. If they insist on being even more stupid then they go on my actual ignore list.