I think if we take a step back and don't try to invent all the wheels ourselves, we'll find that almost all of these questions have established answers from the world of business and human resources.
We do have to get past the first step though, which is agreeing that these are problems we care to solve. The wider community is still divided on that, as illustrated by this thread and the comments on the OP.
Yet conspicuously absent in your post is a link to where those answers are. I suspect that because as soon as you link to one you've actually drawn a line in the ground. Instead of codes of conduct which sort of fuzzily describe that one exists "out there."
And once you start talking about where lines are really drawn, it becomes easy see how little agreement there actually is. Even among people that are more-or-less on the same page regarding which problems "we" care to solve.
But I do know people that do that sort of work, and I also know that when I went looking for a code of conduct for my own project, I found lots of pre-existing material to work with.
You guys are making this out to be a lot harder and more complicated than it actually is.
Often times this amounts to "don't be racist" and similar proclamations - these don't offer guidance as to what's deemed racist. Some people would say opposing affirmative action is racist - is that the standard the project goes by? Based just on those codes of conduct, who knows?
Heck, some people would say the president of the united states is racist, but over 47% of the voters wanted him. If you think that full 47% of the population is terrible and racist, on sheer population grounds you probably just rejected a lot of good people.
This is why I find codes to conduct to be extremely low value, they provide nothing beyond say "don't be an asshole" and a fear of reprisal for political reasons.
It's entirely possible to be racist to some degree while still being a good person overall. That doesn't mean racism is okay, or that it should be acceptable. But suggesting that opposing racism equals branding almost half of the American voters as terrible people is a strawman.
My point is, if you use a code of conduct that simply includes dumbed down provisions with no detail, you have no way of knowing what the views of the project leaders are - you might have risk that kind of treatment because you said something positive about Trump on Twitter.
I suppose you can argue this is a strawman on the grounds that it doesn't seem to be happening so far with projects which have implemented a code of conduct - but I'm worried it might have a chilling effect on political commentary in FOSS communities, causing more people to comment anonymously and disassociate their political views from their real information. This kind of chilling effect is hard to measure in many other cases already.
What's considered "harassment" for example? Does 1 off comment count or does it need to be systemic? What if it was a heat of the moment situation and an apology was made afterwards? Does expressing an opinion less than the generally accepted one about a rape case for example count as misogyny? What about mental health comments not in line with generally accepted opinions, but which might still hold some validity? How about defending political opinions based on your religion?
There are too many questions that I know many people would respond very differently to.