It brings up the question — as a developer, how can you best set boundaries on your customers so that you can have some degree of control over the toxicity of the culture that you're exposed to when interacting with them?
It's a good question. I'm involved in a large open source project that attracts some of this kind of attention. Because of the project's age, much of our infrastructure is old, which actually sort-of works to our advantage here. If you want to be a jerk to us, you need to go find our mailing lists and figure out how to send an email, or register a Bugzilla account and go file some troll bug. Much more effort than posting "You Suck" on GitHub or whatever. The barriers are insulating, which has pros and cons.
The other part that works well for me is disassociating your self from your project. Set strict hours for when you will work on the project, and don't work on it outside of them. Note that checking issue emails counts as work; remove your "work" email from your phone. I'm lucky enough to be a paid developer for the project, so I can clearly define my working hours as when I'm in the office, and ignore issues when I'm not at the office. But even for personal projects, there's no need to respond to issues within hours, or even days, if doing so is burning you out.
And the obvious answer that applies to anyone who creates anything online: Don't Read The Comments. In this case, that means Reddit. Reddit is a cesspool of uninformed users giving maximum visibility to whatever is most appealing to other uninformed users; not a good place to get useful feedback. Find spaces that are supportive and provide useful feedback, cultivate them, and spend your time there.
Hm, dunno, I am tangentially involved in a big open source project which almost never gets any negative comments, neither on Reddit nor here and the feedback is usually useful. Yes, the project uses mailing lists for the development, but there is almost no negativity in other parts of the community.
I have no idea why some projects gets toxic attackers while others are almost entirely spared. One thing which the project prioritizes is taking the time to explain to people why their ideas which look good on paper may actually be missguided.
Label and present your project clearly, both explicitly and implicitly, so that nobody could reasonably get the wrong impression about what level of development and support can be expected.
It brings up the question — as a developer, how can you best set boundaries on your customers so that you can have some degree of control over the toxicity of the culture that you're exposed to when interacting with them?
Personally, I don't think you really can. I think the best thing to do from a developer/maintainer perspective is to identify toxic communities and do you're best to ignore them entirely. That's probably the best long-term approach from a mental health standpoint.
Especially when it comes to social media sites like Reddit, once a community turns hostile there really isn't anything you can do to turn it around.