Preheat the oven to 375° F. Heat a large pot of salted water to a boil. I aim for about 1 1/2 tablespoons of salt in a gallon of water, but usually just eyeball it. Prepare a large bowl with an ice bath for blanching the beans.
Blanch the beans by adding them to the boiling water and cooking for 5 minutes. Then drain in a colander and immediately plunge the beans into a large bowl of ice water. This will stop the cooking process so the beans don't turn mushy. Drain and set aside.
2 pounds fresh green beans
Melt the butter in a large skillet over medium-high heat. Add the onion and garlic, sautéing for 4 to 5 minutes until the onions start to soften. Add the mushrooms (if using), salt and pepper and cook another 1 to 2 minutes.
2 Tablespoons salted butter, 1 medium onion, 2 garlic cloves, 8 ounces baby bella or white button mushrooms, 1 teaspoon kosher salt, 1/2 teaspoon freshly ground black pepper
Sprinkle the flour over the softened onions and stir to combine. Cook for 2 minutes, then whisk in the chicken broth to make sure there are no lumps, then the half and half. Bring the mixture to a simmer and cook until it has thickened, stirring occasionally, about 6 minutes.
2 Tablespoons all-purpose flour, 1 cup chicken broth, 1 cup half-and-half
Pour the sauce over the beans and stir to combine, then transfer to a large 9x13-inch casserole dish and sprinkle with the breadcrumbs and french fried onions.
1/2 cup Panko bread crumbs, 6 ounces french fried onions
Bake for 20 minutes until hot and bubbly. Cover the dish with foil if the onions start to brown too quickly.