Downvoting is to a large degree up to you. Unless the questions is really snarky, I would not even consider it. Your example is one of them where I would not even react, but I want to emphasize that it could be because it's taken out of context. I would NOT rephrase it the way you suggested though. Because it DOES change the question. Granted, they would probably lead to somewhat similar answers, but it's not guaranteed. "Why is XX in language Y so horribly slow?" is about the reason for it being slow, which may be a very interesting and enlightening subject. "How can I speed up XX in language Y?" is instead focused on the solutions. Maybe you could switch "horribly" to "extremely" or just remove the word, but apart from that I think it would have been a bad edit and I would reject it.
Important difference between snarky in a question compared to comments
When writing questions, you are in general not snarky against someone, which you usually are in comments. That thing alone makes me think of this as a problem that you only find when you have found and dealt with all other problems and really cannot stand not having a problem to deal with. Maybe I have a bit of a thicker skin, but I have NEVER encountered a question with problems with snarky formulations. Mostly when they are negative about something, it has nothing to do with anyone who reads the question.
Downvoting: I find neutrally phrased questions most useful, and would like to encourage them/discourage snarky questions.
Downvoting feels quite rough. It's never fun to see your rep drop. Childish? Guilty as charged, but it easy to take downvotes very personal, and especially if they are not motivated.
Editing: this is certainly a direct way to address the problem, and could be constructive (i.e. "here is a better way to phrase this question"). It might lead to more constructive answers (rather than a snark-fest in the comments), and to upvotes for an otherwise useful question.
It might. It might. not. I would suggest being very careful with this. Do changes that objectively make them better, but be really careful about how you phrase yourself. Do not change the question. (Which I think your above examples are)
Commenting: it's a milder way to register my disapproval, and I could give suggested edits in a comment and give the original poster the free choice whether to incorporate them.
Probably the best way to go. In the example above, I can honestly say that in my mind I would think "Wtf? Why is he wasting time for me, himself and everybody who is reading this for this little irrelevant detail?" and I would waste some more time in writing an explanation of why I think my version is better.
Ignoring: life is too short.
Another alternative. Spend some time really thinking what the problem is.