I (a male from the US) was in Marrakech in March this year, and regularly walked the route from the main train station (rad vernacular architecture) to Jamaa el Fna (outdoor market/food vendors at night/troubadour haunt)- you can see the route here:
http://goo.gl/maps/3Q6rm. It's not that it was too far, but I regularly did this day and late at night and didn't feel worried at all. Casablanca was fine as well.
It was a pleasant contrast to my experience in Tangiers eight years ago, when I was followed around for an hour, including into hotels and restaurants. Apparently, according to another thread that I cannot locate now, that issue has gotten much better. Not sure if I need to rush back to Tangiers though.