Melt butter in cast iron skillet over medium heat. Add onions, sprinkle with salt and pepper, and cook until golden brown and caramelized, stirring frequently, about 20 - 25 minutes. Remove to plate and set aside.
Form ground beef into 2 patties (6 - 8 ounces each) roughly the shape of the bread slices. Handle as minimally as possible. Season liberally with salt and peeper. Add a little butter to cast iron pan and cook patties about 3 - 4 minutes a side for medium-rare. Remove to plate and wipe skillet clean.
Prepare melts: arrange bread slices on cutting board and butter top sides. Flip bread over and top each piece with a slice of Swiss cheese. Mound grilled onions on two slices and then place beef patties on top of onions. Flip remaining bread slices/cheese over top of of beef patty. Gently press down on sandwich to help meld together.
Heat cast iron skillet over medium heat and add a bit of butter. Place patty melts in pan, gently press down, and grill until golden brown. Carefully flip melts, press down again, and grill the other side, cover with lid to help cheese melt. Remove to board and cut in half. If desired, swipe with mayo or other topping and serve.