Preheat the oven to 375°F. Grease a large cast-iron skillet, casserole pan, or a 9 × 13-inch baking dish, and set it aside.
Bring a large pot of salted water to a boil. Add the pasta and cook, following the package directions, until 2 minutes shy of al dente. The pasta should still have a bite to it. Drain, and shake out all the water.
Heat the oil in a large non-stick skillet over medium heat. Sauté the shallots until soft, about 3 minutes. Add the garlic and red pepper and cook for another minute. Sprinkle in the flour and stir to coat. Cook for a minute, then whisk in the salt, milk, and broth.
Simmer until thickened enough to coat the back of a spoon, about 4 minutes. Carefully fold in the spinach in two batches. Cook until wilted, 2 minutes.
Add the cheddar cheese and pasta and stir until very well coated in the spinach mixture. Transfer to the prepared dish and spread in an even layer. Sprinkle with the Parmesan (if using).
Bake the mac ‘n cheese until melted and crisp on the top, about 15 minutes. You can pop it under the broiler for a few minutes if you want the top to get extra brown and crunchy. Serve immediately!
To make this low FODMAP, omit the shallot and garlic, and use a sharp aged cheddar which will have less lactose.