In a large ovenproof nonstick or cast-iron skillet, warm 1⁄3 cup oil over medium-high heat. Add the onion and 1⁄4 teaspoon salt; cook, stirring occasionally, until softened, about 4 minutes. Add the potatoes, bell peppers, another 1⁄3 cup oil, 1⁄2 teaspoon salt, and the black pepper and cook until the oil begins to simmer. Lower the heat to medium and cook, stirring occasionally, until the potatoes are tender and lightly browned in places, about 20 minutes.
Transfer the vegetables to a large bowl and let cool slightly. Meanwhile, rinse out the skillet; dry and place back on the stove.
Preheat the oven to 450°. In a large bowl, beat the eggs until foamy; season with 3⁄4 teaspoon kosher salt. Add the beaten eggs to the vegetables and stir gently to combine.
In the skillet, heat 2 tablespoons olive oil over medium heat. Add the egg-vegetable mixture and cook, stirring a little at first to let more of the egg touch the surface of the pan, until the eggs begin to set on the bottom, about 2 minutes. Spread the vegetables into an even layer at the top, and reduce the heat to medium. Cook the tortilla, shaking the skillet occasionally to prevent the eggs from sticking, until the eggs are halfway cooked, about 5 minutes. Transfer the skillet to the oven and cook until the top of tortilla is just set, 3-4 minutes. Turn the heat to broil and cook until the top is beginning to lightly brown in places and the tortilla seems fully set when the pan is shaken, 2-4 minutes. Remove the skillet and quickly place a large ovenproof plate over the top. Carefully invert or slide the tortilla onto the plate and either enjoy immediately with the ham and cheese on the side, or let cool slightly in order to stuff the tortilla.
If stuffing, use a long serrated knife to slice the cooled tortilla horizontally in half. Gently and carefully pull back half of the top piece, then cover the bottom half of the tortilla with a layer of cheese, followed by a layer of ham. Sandwich the ham and cheese with the top half of the tortilla. Repeat on the remaining side. Cut into wedges and serve.