For clarity, I think all three of the quoted comments already show empathy; I just think the first two can retain that empathy while also feeling more direct. (The third, with "Can you take a step back and explain your goal here?", is already fine on that front, and that specific tactic is one I'd highly recommend.)
In the absence of context for the comments in question, I'll have to be somewhat broad in template. For the first, I'd avoid the passive voice like "It would be nice to...", and instead write something like:
"X and Y look good, thanks. For Z, I'd suggest putting this in a data-bind, so that we can more easily switch the view between AB tests in development."
For the second comment:
"I think this will work in many cases, but it might break some limit in the size of $in clauses, which may lead to problem X in the future. I think we can defer that until it becomes a problem, but please keep it in mind if you see a clean way to address it."
For my part, I find that adding rationale also adds more empathy, because it gives the other person the information to reach the same conclusion you did, and it shows trust that you can make non-opaque decisions and still have them hold up. Also helps with mentorship. And taking the time to talk about the things that are good helps when you then need to talk about the things that aren't; I prefer that over the "no news is good news" approach to reviewing.
I'm barging in here from side, but IMHO the empathetic way would require those comments to be different depending on the particular individual they're addressed to; you'd have to know and understand how they'd react to different options and (unconsciously?) tailor your comment accordingly.
Saying "It would be nice to put this in a data-bind" (as in one of the examples in original article) is okay if you think that doing so is optional, insignificant, and the recipient would understand it the same way.
Saying "It would be nice to put this in a data-bind" is okay if you think that the recipient should definitely implement that change unless there are strong contrary arguments, and the recipient would understand it the same way.
If you say the same thing expecting that they'll understand one of the above interpretations, but they understand the other one - that was not empathetic, and you caused a miscommunication. Empathy by definition is personal and contextual, not universal.
That's exactly the reason why I'm suggesting more directness and less ambiguity, while retaining empathy. You can be direct and unambiguous, and distinguish between the two situations you mentioned.
I would use very different phrasings for something optional for the reader to consider versus something critical that they should either do or provide clear justification for not doing.
> Empathy by definition is personal and contextual, not universal.
Somewhat true, and you can get better results if you know the person you're talking to better (which is one reason why it helps to meet the people you work with in person, at least from time to time). But you can also have a mental model of a collection of potential people, and choose responses most likely to produce positive results. You can still have certain priors for your expectations of the people reading your words, even with minimal information.