To a bowl, prepare an ice bath by adding 10 or so ice cubes and adding a few splashes of water. Set a slightly smaller bowl inside the bigger bowl and set a sieve or strain inside the smaller bowl. Set the whole ice bath contraption aside.
To a medium saucepan, add the milk, sugar, coffee beans, cocoa powder, ancho chile pepper, cinnamon sticks, allspice berries and salt; heat over medium until the milk reaches a slight simmer. Once it reaches a simmer, remove the pan from the heat, cover it with a lid or foil and let it steep for 1 hour.
Place a sieve over the mouth of the jar of a blender. Pour the liquid through the sieve and into the blender, removing the ancho chile from the sieve and adding it to the blender. Discard the rest of the stuff. Blend until very smooth. Note: If there are little seeds here and there, not to worry, we're going to strain it again at end of this process. Add the chocolatey milk mixture back to the saucepan and rewarm.
In a medium mixing bowl, beat the egg yolks together, thoroughly. Next you're going to temper the milk mixture. Whisking the entire time, add about 1/4 cup of warm milk to the egg yolks. Add the remainder of the milk to the egg yolk mixture and whisk. Return the entire mixture back to the medium saucepan and place over low heat. Cook the milk and yolk mixture, stirring constantly, until the thermometer reads 170 to 175 degrees F and the mixture appears thick and coats the back of the spoon.
Pour the mixture through the sieve into the bowl. Lastly, stir in the heavy cream. Keep mixing until the mixture is room temperature. Wrap the bowl in plastic and transfer it to the fridge for 4-5 hours, or overnight, until very cold.
Churn the mixture into the bowl of your ice cream maker, according to your ice cream maker's instructions. Serve immediately for soft serve or alternatively transfer to a freezer-safe container and freeze overnight. Garnish with salted pepitas, if you like!