In a large skillet or sauté pan, sauté the shallots in abundant olive oil and a knob of butter for a minute or so, until wilted. Add the zucchini and raise the heat. Toss them as they cook until the zucchini is just tender, about 5 minutes or so. Turn off the heat when the zucchini are done.
Mix the ricotta and the grated Parmesan cheese, together with the basil leaves if using.
Meanwhile, boil the pasta in well salted water until al dente.
Drain the pasta, but not too well and add it to the skillet and toss it with the zucchini over gentle heat. Add the ricotta mixture and mix well.
Serve while still warm.