Add the half-and-half to a saucepan over medium heat. Stir occasionally until the mixture just starts to simmer with small bubbles around the edge. Then remove the pan from the heat.
In a bowl, whisk the egg yolks until smooth. Gradually pour in half of the hot half-and-half mixture while whisking constantly. This warms the yolks gently and prevents them from curdling. Then, return the yolk mixture to the saucepan and stir over medium-low heat until the custard lightly thickens, about 2 minutes.
Add the vanilla, chopped semisweet chocolate, espresso powder (if using), and salt into the custard. Allow the chocolate to melt for about a minute, then whisk until the mixture is completely smooth. Strain the custard through a fine mesh sieve into a clean bowl to remove any lumps.
Divide the smooth custard evenly into six 4-ounce ramekins. Refrigerate for about 2 hours until set. When ready to serve, let the pots de crème sit at room temperature for 15 minutes to soften slightly before enjoying. Top with whipped cream and chocolate shavings if desired.