Cut the onions in half, peel and thinly slice them. Heat a large saute pan over medium heat and add 2 tablespoons of butter to the pan. When the butter has melted, add the sliced onions to the pan and stir them to coat in butter. Cook, stirring occasionally, for 15-20 minutes, until the onions become golden-brown. Turn down the heat gradually to prevent the onions from burning. Set aside.
Put the ground meats in a large bowl. Pour in the barbecue sauce and add a large pinch each of salt and pepper. Mix to thoroughly combine and divide into four equal-sized balls. Shape each ball into a flat oval shape or into a size to match your bread. Heat a large saute pan over medium heat, add a small amount of cooking oil to pan, and add patties to the pan when the oil is hot. Cook for about 2-3 minutes per side. (It's okay if they're a little undercooked in the middle because they will be cooked again later.)
Butter each bread slice on one side. On four of the slices of bread, add the cheese (and pickles, if using); top the other four slices with a dollop of caramelized onions. Place a meat patty on top of the slices with onions, then top the patties with the cheese-topped bread.
Heat a saute, cast iron or grill pan over medium heat. When the pan is hot, add enough sandwiches that can fit into the pan. Press the sandwiches down with a spatula or place a heavy pan on top of them. Cook for a minute or two, until the bread is browned, then flip and repeat the process on the other side. Remove sandwiches from pan when the cheese has melted. Cook any remaining sandwiches.
Remove cooked patty melts to a plate and let them sit for a minute for a minute before slicing them in half and serving.