Cook the penne in salted water according to instructions on package for al dente noodles.
Toast the walnuts if desired. Cook walnuts in a dry medium-sized frying pan over medium heat, stirring constantly for 1-2 minutes until walnuts smell nutty or appear lightly browned. Set aside toasted walnuts. Wipe out pan. If you prefer not toast the walnuts, skip to next step.
Heat olive oil in medium-sized frying pan over medium heat.
Add garlic and red pepper flakes to the pan, cook while stirring constantly for about 10 seconds.
Add the onions to the pan along with salt, black pepper, and dried oregano. Cook, stirring frequently for about 6 minutes or until onions are soft.
Add parsley and walnuts to the onions and stir to combine. Stir in the juice from half a lemon.
When pasta is done, reserve about 1/2 cup of pasta cooking water.
Drain penne and combine with onion-walnut "sauce." If the penne looks dry, stir in spoonfuls of pasta cooking water as needed to reach desired consistency, being mindful that it's salty. Taste and add lemon juice if desired. Serve with grated parmesan if you like.