Heat the oil in a heavy-based casserole over a high heat. When the oil is just smoking, add the garlic bulb halves, cut-sides down, and the onions, and fry for 2-3 minutes, or until the onions are crisp and golden-brown.
Add the octopus pieces and stir fry for 30 seconds, then reduce the heat to its lowest setting. Squeeze over the lemon juice and sprinkle over the bay leaves, thyme and peppercorns, then cover the pan with a lid and continue to cook for a further two minutes, or until the octopus pieces have released their purple-pink juices.
Continue to simmer the mixture over a low heat for 1 hour and 45 minutes to 2 hours, or until the octopus is tender and offers no resistance when pierced with the point of a knife.
When the octopus has stewed and is tender, add the peas and continue to cook, uncovered, for 8-10 minutes, or until the volume of cooking juices has reduced and the peas are tender. Season, to taste, with salt and freshly ground black pepper.
Whisk in the cold butter (or olive oil) until well combined, then sprinkle over the chopped wild fennel fronds, if using. Serve immediately.