Go off season! November, February, April....the zone touristique hotels stand forlorn and empty, the pizzerias in town are all shuttered and abandoned, but life goes on in Mahdia in winter, and the atmosphere is much much more relaxed than in summer. In spring, Cap d'Afrique is prettier anyway, with all the dandelions and grass everywhere...by summer, this has all died and dust prevails.
Don't limit your explorations to the tourity bit of souk by the Skifa (as you enter the old town)...the souvenir shops do peter out after a few hundred metres, and tourists are still relatively rare in the rest of the medina.
In high season, Mahdia may well be a smaller version of Sousse or Monastir...so to get off the beaten track, hop in a louage heading south and in a couple of hours you can feel like an intrepid explorer in the medina of Sfax, Tunisia's second city and one of my favourite places. See my Sfax page for more.
There are now very few boats sailing with the ancient so called Latin sail that was used around the whole Mediterranean for centuries. It has almost disappeared now from the Tunisian coasts and I was very lucky to spot one. I saw it from the road and it was far away. Luckily, it does not sail fast and I could drive into mud trails to get closer to the coast and get this photo.