Put the beef, garlic, thyme, peppercorns and Guinness into a bowl. Cover and marinate for 2-3 hours (or preferably overnight). Take out the beef, pat dry and toss in the flour (strain the marinade and keep the liquid).
Heat some oil in a large casserole dish and brown the beef all over in batches; you want it to colour, not stew. Remove, brown the shallots in the casserole then return the beef and the marinade to the pan.
Cover and simmer for about 1.5 hours or until the beef is tender (or cook in the oven on 160C/fan 140C/gas 3). Cool slightly.
Heat the oven to 200C/fan 180C/gas 6. Roll the pastry to the thickness of a two dollar coin. Sprinkle the Stilton over one half, fold the other half on top and roll again to the same thickness. Cut around the tops of 4 pie dishes (or use one big one). Divide the filling between the dishes, brush a little egg around the rims and top with pastry. Trim the edges then brush more egg over the top. Cook for 20-25 minutes until the pastry is crisp and golden.