Place the tofu on a flat plate and cover it with another flat plate. Place a large can of tomatoes or broth or something fairly heavy on the top of the plate, and let the tofu sit for about 45 minutes. Pour off the water that the tofu will have released from the pressing. Cut the tofu into 1/2-inch cubes.
Meanwhile, soak the noodles in a bowl of warm water to cover for 20 minutes until they are soft (or follow package directions). Drain the noodles.
Heat 2 tablespoons of the oil in a wok or a large skillet over medium-high heat. Add the tofu cubes and sauté until they are golden brown on all sides, about 5 minutes. Transfer them with a slotted spoon to a paper towel-lined plate to drain, set them aside, and wipe out the skillet.
Heat another tablespoon of oil in the skillet over medium-high heat, and sauté the peppers and carrots for 2 minutes, until they start to soften. Transfer them to a paper towel-lined plate to drain, set them aside, and wipe out the skillet. In a small bowl, combine the sugar, 2 tablespoons of the fish sauce, and the lime juice, and set the sauce aside.
When the noodles have been drained, add the remaining tablespoon of oil to the pan and heat over medium-high heat. Add the shallots, and sauté until tender, about 3 minutes. Add the beaten eggs (if using), and stir until cooked, about 2 minutes. Add the noodles and tofu, stir to combine, and heat through. Stir in the vegetables, scallions, and red pepper flakes, and pour in the sauce. Toss over the heat for a minute, then transfer to a serving dish.
Top the Pad Thai with the peanuts and bean sprouts, and pass small bowls of additional peanuts, sprouts, and red pepper flakes at the table if you’d like.
Notes
I did a little dive on the internet to find out how to make a solid vegan substation for fish sauce and took pieces and thoughts from a bunch of suggestions. The answer is a combination of water, soy sauce, salt, dried mushrooms, and kombu if you have it. You can also try a Vegan Fish Sauce recipe. If you want a vegan Pad Thai, you’ll also need to leave out the eggs.