1. In a large skillet, heat the butter over medium-low heat. Add the thinly sliced onions and season with salt and black pepper.
2. Cook the onions slowly, stirring occasionally, for about 20-25 minutes until they become soft and golden brown. Set them aside.
3. While the onions are caramelizing, season the ground beef with salt and black pepper. Form it into 2 equal-sized patties.
4. Heat a separate skillet or grill pan over medium-high heat. Cook the patties to your desired level of doneness, typically 3-4 minutes per side for medium. In the last minute of cooking, place a slice of Swiss cheese on each patty to melt.
5. Spread softened butter on one side of each slice of rye bread.
6. Place two slices of bread, butter side down, in the skillet you used to caramelize the onions. Top each with a slice of Swiss cheese, a beef patty, and a portion of the caramelized onions.
7. Place the remaining slices of bread, butter side up, on top of the onions.
8. Heat the skillet over medium heat and place the sandwiches in it. Cook for about 2-3 minutes on each side, or until the bread is toasted and the cheese is fully melted.