Prep your tools. Freeze your ice cream maker bowl for at least 24 hours if required by your machine.
Have a fine-mesh strainer and a large bowl ready. Chill a lidded freezer-safe container.
Mix the dry ingredients. In a small bowl, whisk the sugar, cornstarch, cocoa powder, and salt until no lumps remain. This prevents clumping later.
Warm the dairy. In a medium saucepan, add the milk, cream, and corn syrup (or honey).
Heat over medium until steaming and small bubbles form at the edges—do not boil.
Whisk in the dry mix. While whisking, slowly sprinkle in the sugar-cocoa mixture. Continue whisking over medium heat until the mixture thickens slightly, about 3–5 minutes. You’re aiming for a light, pourable custard that coats the back of a spoon.
Melt the chocolate. Remove the pan from heat and add the chopped dark chocolate.
Let sit for 1 minute, then whisk until completely smooth and glossy. Stir in the vanilla (and espresso powder, if using).
Strain and chill. Pour the base through a fine-mesh strainer into a clean bowl to remove any tiny lumps. Press plastic wrap directly onto the surface to prevent a skin.
Chill until fully cold, at least 4 hours, but overnight is best.
Churn. Stir the chilled base, then churn according to your machine’s instructions, typically 20–25 minutes, until it reaches a soft-serve consistency.
Cure in the freezer. Transfer to your cold container, press parchment or plastic wrap onto the surface, cover, and freeze 2–4 hours to set. Scoop and serve.