Traveling alone in the medina is not difficult. It is conspicuous, which is a different problem and a solvable one. The fix is mostly pacing: move like you have been here before, eat at the hours locals eat, and do not stand still in the middle of a lane with a map open.

Morning

Be in the souks by eight, before the tour groups come through Bab Agnaou. Two hours of that is enough. The Saadian Tombs and the Bahia Palace both open at nine and both empty out by eleven if you go straight there. Buy nothing before noon; the first price of the day is a formality.

Afternoon and after

Lunch alone is easiest at a rooftop, not for the view but because a table for one on a roof is unremarkable, whereas a table for one at street level invites conversation you may not want. Jemaa el-Fnaa is worth an hour at dusk and no more. For dinner, the food stalls are fine and cheap, but the ones with laminated photographs are for you and the ones with a crowd of men eating standing up are for everyone else. Choose accordingly.