Preheat oven to 350 degrees F (175 degrees C). Grease a 2 1/2- or 3-quart baking dish.
Bring a large pot of lightly salted water to a boil. Cook elbow macaroni in the boiling water, stirring occasionally until tender yet firm to the bite, 8 minutes. Drain. Transfer pasta back to pot; cover and keep warm off heat.
Place bacon in a large skillet and cook over medium-high heat, turning occasionally, until evenly browned and crisp, about 10 minutes. Drain bacon slices on paper towels. Crumble.
Place butter and minced garlic in a saucepan over medium-high heat; stir until butter is melted. Whisk flour into butter mixture, and continue whisking until flour starts to turn golden brown, about 1 minute. Slowly add milk, heavy cream, salt, and pepper to the saucepan, whisking until there are no lumps. Bring to a boil, stirring frequently. Reduce heat to medium.
Stir grated Cheddar cheese into the cream mixture, stirring until the cheese is melted. Add basil pesto sauce and half of the crumbled bacon; stir. Transfer mixture to pot with cooked elbows; stir to combine. Pour into prepared baking dish.
Mix panko bread crumbs and Parmesan cheese together in a bowl. Sprinkle topping evenly over macaroni and cheese.
Bake in preheated oven until bubbly and just starting to brown, about 20 minutes. Top with remaining half of bacon.
Preheat the oven's broiler. Place baking dish under broiler until browned, 1 to 3 minutes. Garnish with chopped basil.