Shoes must be removed. Try to keep a sense of humor in this male dominated society. The reality of it is, it's a difficult place for women seeking peace and solitude. Harrassment in the form of sales tactics, begging and sexual propositions can become incessant and annoying especially for solo travelers. The best thing to do is to ignore the comments and walk confidently to your anticipated destination.
Many men are merely curious, and are eager to strike up a conversation and practice their English.
There were moments when I was glad I stopped to speak with the locals. It made my travels much more interesting interacting with them. Just use common sense and follow your female intuition. Rarely will you see Moroccan women, let alone any women, sitting in cafes especially at night. The reason being, there are only certain 'fashionable' places where Moroccan women hang out without tarnishing their reputations.