Slice the kernels off the corn cobs, then use the back of a chef's knife to scrape the milky liquid that's left on the cob.
Heat 1 tablespoon of the olive oil in a medium skillet over medium heat. Add the onion and cook until soft, about 3 minutes. Add 1½ cups of corn kernels and the whole crushed garlic cloves and cook until tender, about 3 minutes more. Transfer to a blender and add the milky corn liquid, cashews, water, lemon juice, smoked paprika, the ½ teaspoon of sea salt, and a few grinds of black pepper. Blend until creamy, adding more water as needed to create a pourable consistency. Set aside.
Bring a large pot of salted water to a boil. Prepare the pasta according to the instructions on the package, cooking until al dente. Reserve ½ cup of the hot pasta water, then drain.
Meanwhile, wipe out the skillet and heat the remaining 1 tablespoon olive oil over medium heat. Add the remaining 2½ cups of corn, the scallions, a pinch of salt, and a few grinds of black pepper and cook, stirring occasionally, until tender, about 3 minutes. Add the spinach, hot pasta, the corn sauce, and ¼ to ½ cup of the reserved pasta water, as needed to create a creamy sauce. Season to taste and serve immediately with the sliced basil and microgreens, if using.