Preheat the oven to 375° F.
Heat a large pot of salted water to a boil.
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.
Drain and set aside.
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.
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.
Pour the sauce over the beans and stir to combine.
Transfer to a large 9x13-inch casserole dish and sprinkle with the breadcrumbs and french fried onions.
Bake for 20 minutes until hot and bubbly.
