I wanted to reply to specific parties, but there turned out to be so many that I figured I'd put this as a general response, because I think we've (so far) done a decent job with our two sons (now 17 and 20) as well as with all their friends who passed through our house.
As other commenters have mentioned, we started very early with the idea of consent, sometimes using choices, i.e. since you have to wear a shirt to school, "would you prefer to wear the blue shirt today, or the red one?" We reinforced messages of consent (or non-consent) from other people, and from both parents ("Papa just told you he doesn't want you to head-butt him in the crotch -- would you like to play chase instead, or is this a good time to take a break?").
The older one was interested in girls pretty early, and a good friend of his starting in 6th grade was transgender, so that was a great opening for having conversations about consent, and acceptance, and some of what was coming (culminating in me looking at my kid and saying "look, if the two of you decide you want to get into each others' pants you may have to have a bit more than the usual amount of conversation, but other than that I fail to see how this is relevant to anything at all."). When we drove places, song lyrics were subject to the "object or agent" test -- if they're discussing another person as an object, please skip the rest of the song, because I don't care to listen to it. Arguments/discussions were had, especially about songs that were trendy. (We missed a turn and went 45 minutes out of our way once, because a kid doubled-down 5ish years ago "mom, the song's about transportation options!")
And all along, we leaned hard into treating other people as just as fully human as yourself. And we tried hard to expose our sons to other men who also treat other people (of all genders, and races, etc) as fully human. And to model that behavior ourselves.
Then we moved on to (as I've mentioned elsewhere, or perhaps here) the three C's that have to happen before sex: Conversation (you'd better at least know first and last name, and some other stuff about this person), Enthusiastic Consent (for every act, every time) and protection from unwanted pregnancy and STDs (spelled Condom in our house, obviously, since that's what boys can control). Actual conversation that happened "Mom, I asked her what she liked/wanted and she couldn't answer!" "That means she's not ready in the way that you are, and no sex for you in this instance." Because if you can't both have a conversation about what you both want, then you're not both ready.
Because, look, that's all we're talking about here -- it's not a huge giant mysterious philosophical situation, right? Treat other people as full human beings with just the same agency as you want for yourself, and we're all pretty much there.
As I read this thread, a lot of what I see is guys saying "really? That happens to you -- and all women -- all the time?" as well as "really? You experience XXX (this thing I do, or I never thought about, i.e. men walking up behind you and putting their hands on your shoulders) as a potential threat, and you have to expend mental and emotional energy dealing with it?" But once y'all have been educated past that hurdle, the solution is pretty easy -- Don't do to other people what they don't want done to them.
And, since I work at home, I can make this point with other teenagers, too -- when a bunch of kids having lunch in my house started pinching each other and squealing, it was easy for me to pass through the kitchen to refill my coffee cup and say "Miles, if Peter is OK with you pinching his ass I have no problem with it, but what I'm hearing doesn't sound like consent. Have you asked him if it's all right?" (Because, I decided raising boys into good men requires re-examining a lot of my assumptions about the world, and jettisoning my own embarrassment sometimes. And once I was there, I figured I'd spread the message as opportunities arose.)