Cook the pasta according to the package directions. Drain and return to the pot.
Meanwhile, melt 3 tablespoons of the butter in a large skillet over medium-high heat. Add the leeks, chard stems, ½ teaspoon salt, and ¼ teaspoon pepper. Cook, stirring occasionally, until tender, 4 to 6 minutes. Add the squash and broth and bring to a boil. Reduce heat and simmer, covered, until the squash is tender, 8 to 10 minutes.
Add the squash mixture (and any liquid), chard leaves, pecorino, the remaining 2 tablespoons of butter, and ½ teaspoon salt to the pasta and toss to coat.
Serve topped with the pistachios and additional pecorino.