In a small stainless steel saucepan, whisk together the sugar, corn starch, and flour until fully combined and free of lumps. Gradually drizzle in the heavy cream, whisking continuously to create a smooth paste. Once fully incorporated, pour in the milk and mix well. Add the egg yolks one at a time, whisking thoroughly after each addition to ensure a silky consistency.
Gently massage the vanilla bean to loosen the seeds inside. Using a sharp paring knife, slice the bean lengthwise and scrape out the tiny seeds from both halves. Add the seeds to the saucepan, then drop in the scraped pod for extra depth of flavor.
Set the saucepan over medium-low heat and whisk constantly until the mixture thickens—this process may take up to 10 minutes. If needed, slightly increase the heat to medium, but avoid leaving the pan unattended to prevent scorching.
Once the custard starts to thicken, reduce the heat and continue stirring. When small bubbles appear, allow it to cook for just 5 seconds while whisking, then promptly transfer the mixture to a clean bowl. If desired, strain the pastry cream through a fine mesh sieve to remove any bits of curdled egg.
Add the butter and stir until completely melted and evenly incorporated. If using vanilla extract instead of a vanilla bean, mix it in at this stage. Place a sheet of plastic wrap directly over the surface of the custard to prevent a skin from forming. Refrigerate for at least 4 hours until fully chilled. Use within 3 days for the best texture and flavor.