That fact that it's hard for you to imagine just means your imagination isn't very good
It happens. People leave tech communities because of it. I don't know what else to tell you. I've provided citations to this effect in a bunch of other comments.
It's important to note, though, that people can do or say racist or sexist things without targeting it at someone. That would still impact someone's decision to stay in the community, even if the person who said it didn't mean to offend them.
It's just hard to imagine how racism or sexism would enter into to a community like this because the race and sex of the participants is not known, and you're not even discussing races or genders at all, heck you're generally not discussing people at all.