Add onions, butter, salt, and pepper to the container of an Instant Pot or other multi-use pressure cooker and stir to combine.
Secure the lid and adjust vent to seal. Cook on high "Pressure Cook" setting for 2 minutes. Once cycle is complete, immediately release pressure. Carefully remove lid.
Drain excess liquid from onions and return them to pot.
Cook over high "Saute" setting, stirring constantly, until onions are deeply golden and caramelized, This can take 10-20 minutes depending on your onions and how much liquid they have released
Optional - Add white wine and cook down again until wine is evaporated.
Remove from heat and store in an airtight container in the refrigerator for up to 1 week.
Notes
Readers have had a huge variation in results so I've revised my directions. Mine worked beautifully with 5 minutes of pressure cooking but for others that was too long.So you need to find a baseline for your unit and I recommend you cook them the first time for only a minute or two to see what happens with your unit. If they are wilted completely, that's good, you can start to saute to brown them.But if some are still a bit firm, you can try bringing them to pressure again for another two minutes and then check your results before sauteing...or simply saute everything longer and pressure cook with additional time any succeeding times you make them.