Cut the corn kernels off the cobs and transfer to a bowl, then scrape the cobs with the back of a knife over the bowl to extract the liquid; set aside. Put the corncobs in a large pot and fill with water; season with salt. Cover and bring to a boil, then add the pasta and cook as the label directs; reserve 1 cup of the pasta cooking water, then drain. Discard the cobs.
Meanwhile, heat 2 tablespoons olive oil in a Dutch oven or heavy-bottomed pot over high heat. Add half of the mushrooms in a single layer and cook, undisturbed, until golden, 4 to 5 minutes. Season with salt, stir and continue cooking until tender, about 5 more minutes; transfer to a large bowl. Add another 2 tablespoons olive oil to the pot and repeat with the remaining mushrooms. Transfer to the bowl.
Add the remaining 1 tablespoon olive oil, the garlic and pepper flakes to the pot; cook, stirring, until the garlic is soft, 1 to 2 minutes. Stir in the kale and season with salt. Cover and cook until wilted, about 3 minutes. Add the corn kernels, mushrooms, scallions and butter. Cook, stirring, until the butter is melted and the mixture is heated through, about 2 minutes. Add the pasta and 1/2 cup of the reserved pasta cooking water; cook, stirring, until heated through, 1 to 2 more minutes, adding more cooking water as needed to loosen the sauce. Season with salt and pepper.