Preheat the oven to 350 degrees.
Cut the green beans in half if you like the pieces to be a little smaller. Blanch the green beans; drop them into lightly salted boiling water and allow the green beans to cook for 3-4 minutes. Remove them from the boiling water with a slotted spoon and immediately plunge into a bowl of ice cold water to stop the cooking process. Drain the beans once they are cool and set aside.
Add the bacon pieces to a skillet over medium heat. Cook the bacon for 2 minutes, and then add the peppers, garlic and onions, and continue cooking until the bacon is done (but not crisp) and the onions are golden brown, 3-5 minutes. Remove from heat and set aside.
In a separate saucepan, melt the butter over medium heat. Sprinkle the flour into the pan and whisk immediately to evenly mix it into the butter. Cook for a minute or two, and then pour in the milk and half and half. continue cooking, whisking constantly, while the sauce thickens, about 2 minutes. Add 1 1/2 teaspoons salt, some black pepper and the cayenne, and then add the grated cheese. Stir while the cheese melts. Turn off the heat.
Add the bacon/onion mixture and stir to combine. Add the green beans and stir gently to combine. Pour into a baking dish and top with the panko. Bake until the sauce is bubbly and the panko is golden, about 30 minutes.