Bring a large pot of salted water to a boil and cook the spaghetti according to package directions until al dente; drain and set aside.
While the pasta cooks, slice the mushrooms, trim the snow peas, cut the green onions into 1/2-inch pieces, and cut the carrots into matchsticks or shred them; mince the garlic and grate the ginger if using.
Heat a large skillet or wok over medium-high. Add mushrooms and sauté 2–3 minutes, using 3 tablespoons water or broth for a no-oil method, or add toasted sesame oil if using for more flavor.
Add the snow peas, carrots, and green onions to the skillet and cook about 5 minutes, stirring occasionally, until vegetables are crisp-tender.
Reduce heat to medium and add the minced garlic (and grated ginger if using); stir and cook about 1 minute until fragrant.
Add the cooked spaghetti and tamari to the skillet; toss well to combine and heat through for 2–3 minutes, adjusting tamari amount to taste.
Remove from heat and top with sesame seeds and mung bean sprouts if desired, then serve warm or chilled.