Frozen French-cut green beans can be used in place of fresh to save time. Make sure to thaw them first, drain well, and pat dry with paper towels.
Heat 1/2 inch of safflower oil in a medium skillet over medium-high. Toss shallot rings with 1 tablespoon flour. Fry the shallots in batches, turning frequently, until golden brown, about 3 minutes. Transfer to paper towels to drain. Season with salt.
Cook green beans in a large pot of salted boiling water until bright green and just tender, about 5 minutes. Drain and rinse with cold water to cool. Drain well and pat dry with paper towels. Trim beans, slice in half lengthwise, and cut into 2- to 3-inch pieces.
Preheat oven to 375 degrees. Heat a large straight-sided skillet over medium-high. Add bacon and cook, stirring occasionally, until browned, about 8 minutes. Transfer to a paper towel-lined plate. Drain and discard fat.
Return skillet to medium-high. Add butter, onion, and mushrooms. Season with salt and pepper. Cook, stirring occasionally and scraping up brown bits on the bottom of skillet as the vegetables release their juices, until tender and just beginning to brown, about 4 minutes. Reduce heat to medium. Add remaining 3 tablespoons flour and cook, stirring, until mixture begins to turn golden, 1 minute. Slowly stir in milk and continue stirring until mixture coats the back of a spoon, about 13 minutes. Remove from heat. Stir in mustard, cayenne, and Worcestershire. Season with salt and pepper. Stir in cooled green beans and 1/2 cup reserved cooked bacon.
Transfer mixture to a 2 1/2-quart shallow baking dish; cover. Bake until mixture is bubbly and heated through, 15 minutes. Uncover, top with remaining bacon and fried shallots, and serve immediately.