Peel and cut the potatoes into chunks about 1 inch (2.5 cm) in size. Peel and thinly slice the onion. Heat a large frying pan over medium heat with a generous amount of olive oil. Add the potatoes and cook for about 8 minutes, stirring occasionally. Then add the sliced onion (and sliced pepper, if using) and continue cooking for another 8–10 minutes, until everything is tender and lightly golden.
Meanwhile, crack the 4 eggs and 2 additional yolks into a large bowl and beat lightly with a fork. When the potatoes and onions are ready, drain off any excess oil and add them to the eggs. Mix well and season with salt.
Heat a medium non-stick frying pan over medium heat with a little olive oil. Pour in the egg and potato mixture, spreading it evenly. Cook for about 2 minutes, until the underside is lightly browned but the centre remains soft and slightly runny.
To flip the tortilla, place a plate upside down over the pan. Holding the plate firmly with one hand and the pan handle with the other, quickly invert the pan so the tortilla lands on the plate. Return the pan to the heat, add a drizzle of oil, and carefully slide the tortilla back in to cook the other side.
Shape the edges neatly with a fork and cook for about 1 minute more, until just set. Turn off the heat and slide the tortilla onto a serving plate. Serve warm or at room temperature.