Caramelize the onions. Heat a large cast iron skillet over medium heat, then add 2 Tbsp unsalted butter. Once melted, add the onions and cook, stirring occasionally every few minutes, until the natural sugars release and the onions take on a deep, golden brown color, about 35-40 minutes total. Season with 1 tsp Kosher salt, stir well, then cook for an additional 5-10 minutes. The onions should be nutty, caramelized on all sides, and almost breaking apart in the pan. Remove the caramelized onions from the skillet. This can be done up to 3 days in advance.
Season the burger patties. Divide the ground beef into 4 equal portions, then shape them to roughly match the bread slices. Each should weigh ~4 ounces. Season the top of each patty generously with Kosher salt and freshly ground black pepper. If using mustard, spread about ½ teaspoon on top of each patty. Heat the same cast iron skillet to medium-high. Do not wipe out the skillet.
Cook the burgers. Place the burger patties in the skillet seasoned side down, then use a spatula or a weight to press down firmly. Immediately season the top of each with additional Kosher salt and black pepper to taste. Cook for about 2-3 minutes on the first side, then flip and cook an additional 2 minutes more. Transfer to a plate or wire rack.
Toast the bread. You can wipe out the skillet or not. Heat 1 of the remaining tablespoons of butter in the skillet over medium heat, then add 2 slices of rye bread. Begin assembling the sandwiches
Assemble the patty melts. Place 1 slice of Swiss cheese on each piece of bread, then add 1 burger patty and a few tablespoons of caramelized onions on top. Finish with a second slice of Swiss cheese (or American cheese), then place the remaining bread slices on top. If you have a sandwich weight, press down firmly on each sandwich. Alternatively, you can press down with a spatula. Spread the last remaining 1 Tbsp of butter on the top of each slice of bread, then very carefully flip each sandwich over. Cook for 2-3 minutes, or until the cheese has fully melted and the bread is toasted.
Slice, then serve. Transfer each patty melt to a cutting board, then slice on the diagonal. Serve immediately with chips and pickle spears!