01 - Melt 2 tablespoons of butter in a large skillet over medium heat. Add thinly sliced onions and ½ teaspoon salt. Cook, stirring occasionally, until deeply caramelized and golden brown, about 15 minutes. Remove from skillet and set aside.
02 - Divide ground beef into 4 equal portions and shape each into a patty matching the size of bread slices. Season both sides with salt, black pepper, and garlic powder if using.
03 - Using the same skillet over medium-high heat, cook patties for 3 to 4 minutes per side until browned and just cooked through. Transfer patties to a plate.
04 - Arrange 4 slices of rye bread. On each, layer 1 slice of cheese, a beef patty, one-quarter of the caramelized onions, another slice of cheese, and top with remaining bread slice.
05 - Clean the skillet. Spread softened butter thinly on the outside of each sandwich. Place sandwiches in the skillet over medium heat, grilling 2 to 3 minutes per side while pressing gently with a spatula, until bread is golden and cheese is melted.
06 - Slice sandwiches in half and serve immediately while hot.