Preheat oven to 350°F.
Pat stew beef dry with paper towels and season with salt and pepper. Heat one tablespoon cooking oil in a Dutch oven or similar oven-safe pan over medium-high heat. Brown beef in batches, removing with a slotted spoon to a plate when browned. (This step can be skipped if you are using pre-cooked leftovers.)
Add the remaining two tablespoons of oil to the pot and reduce heat to medium. Add onions, carrots, potatoes, and mushrooms if using, and cook until beginning to soften, about 5 minutes.
Stir in tomato paste and garlic and cook until fragrant, about 30 seconds.
Add flour and stir to coat the vegetables. Cook for one minute to remove the raw flour taste.
Stir in peas, broth, tamari sauce, Worcestershire sauce, and wine if using.
Return the beef to the pot and bring to a simmer. Cover the pot and transfer it to the oven. Cook until the meat is tender, about 1 hour.
Remove the beef mixture from the oven, and increase oven temperature to 400°. Transfer the beef and vegetables to a deep-dish pie plate or small casserole dish. Allow filling to cool for 30 minutes (this prevents a soggy crust). Season with thyme, salt, and pepper to taste.
Brush the edge of the pie plate or casserole dish with beaten egg. Top the filling with pie dough. Using your fingers or the back of a spoon, crimp the overhanging dough around the edge of the pie.
Cut four to six 1-inch slits in the top around the center of the pie crust, midway between the center and the edge of the pie. Brush dough with remaining beaten egg.
Place the pie on a rimmed baking sheet and bake in the preheated oven until the crust is golden brown, about 30 minutes. Transfer the pie to a cooling rack and allow it to cool for 20 minutes. Serve warm.