Amazing place.... generally pretty safe, but with a high 'hassle' level from very skilled shopkeepers.
here're some tips on souk and medina safety
Phil WN safety hub almost 6 years ago
This is the trip I did, personally I'd recommend all the cities on it barr Casablanca though the latter does have an amazing mosque.
Not far from Marrakesh is the amazing Ait Benhaddou, an ECO-UNESCO site not to be missed. It's like a different world & should blow you away.
Erford is in the Sahara Desert, an experience in itself. Fez and Rabat are amazing too, Marrakesh is probably the most touristy so you'll be hassled a bit more there. It didn't compare to the hassle level in Egypt though which is off the barometer. almost 6 years ago