Cook's Illustrated/America's Test Kitchen has a pretty foolproof method.
The trick is exactly controlling the cooking time and temperature. When you have a large pot of water, if you add in eggs, the temperature of the water drops, and has to heat back up to boiling. This is a highly variable process, depending on volume of water, heat of the burner, heat capacity of the pot, number of eggs, etc.
What they've arrived at, instead, is to just use about 1/2 inch of water in the pan. You heat it up to boiling, and when the eggs are added, there's so little water in the pan that it gets heated back up to boiling very rapidly. This makes the temperature and time cooked very, very consistent which allows for consistent results, even when varying between 2 to 6 eggs.
They are actually steaming the eggs, essentially.
While their site is behind a paywall, many others have shared the method on other sites -
Bring 1/2 inch water to boil in medium saucepan over medium-high heat. Using tongs, gently place eggs in boiling water (eggs will not be submerged). Cover saucepan and cook eggs for 6 1/2 minutes.
The Bitten Word: Foolproof Soft Boiled Eggs
NOTE: Cook's Illustrated recommends a shorter steaming time, if I recall correctly, but that yields a very, very runny egg and whites. I think this site increased the time for more solid whites, and soft or runny yolks. You'll need to tweak it a bit between 5 to 6.5 minutes to find how you like it. The nice part is, once you do, you can easily replicate it!