Preheat oven to 375 degrees with rack in middle position. Butter a 2 1/2- to 3-quart baking dish.
2
Cook pasta in a large pot of boiling salted water until al dente, drain, and return to pot.
3
While pasta cooks, melt 4 tablespoons butter in a large saucepan over medium-high heat. Whisk flour into butter and continue cooking until roux is golden and fragrant, about 2 minutes. Whisk milk into roux and boil, whisking constantly, until thickened, about 5 minutes.
4
Remove from heat and stir in cheese, cayenne, and black pepper. Pour cheese sauce over pasta and stir to combine. Transfer to prepared baking dish.
5
In a medium bowl, combine panko with remaining 3 tablespoons butter. Sprinkle over macaroni and cheese, place on a rimmed baking sheet, and bake until golden on top, 20 to 30 minutes.