Place the gammon skin side down in a large saucepan. Add 4 tbsps of the treacle and the mustard seeds, allspice, mace, bay leaves, peppercorns and orange zest. Pour over all but 2 tbsps of the stout, then add enough cold water to cover the meat completely. Bring to a gentle simmer over a medium heat, skim off any scum from the surface, then cover and simmer gently for 1 ½ hours. Remove from the heat and leave to stand in the liquid for 30 minutes.
Preheat the oven to 200°C/Fan 180°C/Gas 6. Lift the ham out of the liquid, then carefully cut off the skin, leaving as much fat beneath as possible. Score this in a diamond pattern, and stud with cloves at each intersection. If necessary, cut a thin slice of ham from the base of the joint so that it sits without toppling over. Put the ham in a foil lined roasting tin just slightly larger than the joint.
Mix the reserved Guinness or stout with the remaining treacle, mustard powder and half of the demerara. Drizzle all over the fat. Bake for 20-25 minutes, basting and sprinkling with the remaining sugar twice during cooking, until the glaze is caramelised and bubbling. Allow to cool completely before serving.