Firstly is alcohol even available? If so do I need a permit or is it
just a case of showing your passport at the store?
So as to sell alcohol, stores, bars, restaurants, etc. have to pay quite high taxes. This explains why you will not find alcohol everywhere in every possible place. However, around tourist spots, you will not have much trouble to find some.
Note that there are local beers in Morocco. The country is also producing wine, which is not exclusively meant for exportation ... You can even find some really good wine.
If I recall correctly, there is a rule in Morocco that forbids selling alcohol to Muslims or that forbids Muslims to drink alcohol.
I imagine public drunkenness doesn't go down well either.
Right. Staggering around the medina of Marrakesh is not that popular. Bawling in religious neighborhoods or in the vicinity of a mosque even less so. It is a matter of respect and etiquette.
Anyway, if you want to get trashed, do it at your Hotel's bar.