Melt butter in an electric or stovetop pressure cooker over medium heat.
Add onions and baking soda and stir to combine.
Season with salt and pepper.
Cook, stirring, until onions slightly soften and start to release liquid, about 3 minutes.
Seal pressure cooker and heat to high pressure (12.5 to 15 psi).
Cook at high pressure for 20 minutes.
Release pressure by allowing steam to vent, then remove lid.
Continue cooking with lid off, stirring constantly, until liquid inside has completely reduced and the onions are deep brown and sticky, about 5 minutes.
