Heat oven to 190C/170C fan/gas 5. Lightly grease a roughly 20 x 30cm shallow ovenproof dish. Put the butter in a large saucepan and place over a low heat until just melted. Remove the butter from the heat and stir in the sugar until well combined.
Whisk the eggs together in a large bowl. Gradually add the eggs to the butter and sugar, beating well with a wooden spoon in between each addition. Sift the flour and cocoa powder on top of the egg mixture, then beat hard with a wooden spoon until thoroughly combined.
Pour into the prepared tin or dish and nestle the pears into the chocolate batter. Put the chocolate on a board and cut into chunky pieces roughly 1.5cm with a large knife. Scatter the chocolate pieces over the batter and sprinkle with almonds, if you like. Can be frozen at this stage.
Bake in the centre of the oven for 30 mins or until the mixture is crusty on the surface and lightly cooked inside. Do not allow to overcook, as the cake will become spongy rather than gooey in the centre. Serve warm with cream or ice cream