Caramelize the onions. Melt 2 tablespoons of the butter along with the olive oil in a large dutch oven over medium heat. Once the butter is hot and foamy, add the onions and toss well to coat. Cover the pot and let the onions cook for 10 minutes, until they’re starting to wilt. Remove the lid, lower the heat, and add the thyme. Continue to cook the onions, stirring every so often, until they’re deeply caramelized, about 40 minutes. Transfer the onions to a bowl and set aside. This step can be done up to 2 days in advance, but I recommend not washing the dutch oven so that you can use the fond to help build flavor in the sauce.
Make the panko topping. Melt the butter in a skillet over medium heat and add the thyme. Cook for 1 minute, until fragrant. Add the panko and stir well to coat. Cook for 2-3 minutes, stirring occasionally, until the panko is starting to turn golden brown. Remove from the heat, season with salt and pepper and set aside until ready to use.
Preheat an oven to 425 F. Lightly grease a 9x13, or 3 quart baking dish with butter. Set aside.
Bring a large pot of salted water to a boil and cook the pasta to just shy of al dente, usually 2-3 minutes short of the package cooking times. Drain the pasta in a colander and rinse with cool water to stop the cooking process. Let the pasta drain while you make the bechamel.
Build the sauce. Melt the rest of the butter in the same dutch oven you used to caramelize the onions, scraping up any browned bits from the bottom of the pan. Whisk in the flour and cook for another 2-3 minutes to cook any raw flour flavor out. Slowly whisk in the half and half and bring to a gentle simmer until it’s thickened. Stir in the dijon, nutmeg, and heavy cream. Remove the pot from the heat and whisk in the cheese, a bit at a time, until the sauce is smooth and the cheese is completely melted. Season to taste with salt and pepper.
Bake. Fold in the caramelized onions and cooked pasta and stir well. Transfer the mac and cheese to the prepared baking dish and top with the panko breadcrumbs. Transfer to the oven and bake for 15-20 minutes, or until the panko is golden brown and the cheese is bubbling. Let the mac and cheese rest for 5 minutes before serving.