I uh, I do understand what you're saying. My empathy is overflowing, and I've seen friends that have gone from timid to "over confident" in order to find more success in dating... so I can understand that a million thoughts were flying through his head when he decided to go for it.
BUT, the two were strangers, in a topic-oriented setting, and she rebuffed his first attempt. That could have, and should have been the end of the story...
Put another way: if he had hugged her, she said "We just met..." and that was the end of it, we wouldn't be having the conversation at all.
Unfortunately, as you allude, there's not really a definitive way of solving this problem unless we build a way of giving passive signals constantly. Some sort of an indicator or smart phone app "Yes, I am willing to be hit on by you and you, but not you and you". There's a weird idea...