In a large skillet, melt 2 tablespoons of butter over medium-low heat. Add the onions and cook over low heat, stirring occasionally, until they are golden and soft - about 30 minutes.
Make the sauce by combining the mayonnaise, ketchup, mustard, garlic powder, and black pepper. Set aside.
Heat a large cast iron skillet over medium-high heat. Add two tablespoons of butter then cook the burger patties according to the package instructions. Wipe the skillet clean.
Assemble each sandwich by spreading the sauce on one side of all 8 slices of bread. Divide the onions between 4 slices of bread. Top each with a burger patty, one slice of each cheese, and then another slice of bread.
Add 2 tablespoons of butter to a skillet over medium-low heat. Swirl to coat the pan with the melted butter. Add the assembled sandwiches and cook until the bread is golden brown. Flip the sandwiches and add the remaining 2 tablespoons of butter. Move the sandwiches around to coat them in butter. Cook until golden brown. Serve immediately.