Locking header jumper
I have seen poor quality jumpers that almost fall off and also seen poor quality dip switches as well as excellent quality in both.  But these are the two best choices. Gold plating gives best protection from oxidation.

https://www.digikey.com/products/en/switches/dip-switches/194