No it hasn't always been, it is a very, very recent reasoning. Talking to complete strangers is fun and I am always friendly. I don't necessarily do it in the street but it has happened.
Talking to strangers is fine under the right circumstances. (Maybe a bit weird if it's literally in the street, which is what the French law covers.) You're the one who specifically said "approaching people with a sexual interest." That's a far cry from simply "talking."