Cook the penne according to the package directions.
Meanwhile, heat the oil in a large saucepan over medium heat. Add the onions, ½ teaspoon of the salt, and ¼ teaspoon of the pepper and cook, covered, until the onions are softened, about 8 minutes.
Add the garlic and mushrooms and cook, covered, for 6 minutes more.
Add the wine and cook, uncovered, for 3 minutes.
Stir in the escarole (if desired), chopped herbs, and remaining salt and pepper, and cook for 4 minutes. Add tomatoes and heat through. Stir in basil.
Transfer the pasta to plates, spoon the sauce over the top, and sprinkle with the cheese.