Caramelise the onions for the pastry. In a small pan, melt a knob of butter over low heat. Add the sliced onions with a pinch of salt and cook slowly, stirring often, for about 30–40 minutes until deep golden. Let cool, then chop finely.
Make the pastry. Mix the flour and salt in a bowl. Rub in the butter and lard until it resembles breadcrumbs. Stir through the chopped onions. Add the water a little at a time until it comes together. Wrap and chill for at least 30 minutes.
Brown the beef. In a large heavy pot, heat oil over medium-high heat. Brown the beef in batches, then set aside.
Build the base. In the same pot, reduce the heat. Add the diced onion and garlic and cook for 10 minutes. Stir in tomato purée, then pour in the wine or ale. Scrape the bottom of the pot.
Add stock, herbs, and seasoning. Return the beef to the pot. Stir in beef stock, mustard, Worcestershire sauce, and thyme. Bring to a simmer, cover, and cook gently on the hob or in the oven at 160°C (fan) for 2–2.5 hours
Reduce and enrich. Remove the lid for the last 30 minutes if the sauce needs thickening. Discard thyme sprigs. Stir in Stilton off the heat. Let cool.
Assemble the pie. Roll out two-thirds of the pastry and line a deep 20cm pie dish. Fill with cooled beef mixture. Roll out the remaining pastry and place on top. Crimp the edges and cut a small steam hole. Chill for 15 minutes.
Bake. Brush the top with beaten egg. Bake at 200°C (fan) for 35–40 minutes or until golden.