Place the shelled pistachios in a dry skillet over medium heat. Toast, stirring constantly, for about 5 minutes or until they're lightly golden and fragrant.
Transfer the pistachios to a plate and let them cool completely.
Put the cooled pistachios into a high-powered food processor. Process on high speed, scraping down the sides occasionally, until a creamy paste forms (about 5 to 10 minutes).
In a small saucepan over medium-low heat, combine the pistachio paste, powdered sugar, whole milk, unsalted butter, and a pinch of salt.
Whisk continuously for 5 to 7 minutes until the mixture thickens slightly and reaches a custard-like consistency, being careful not to let it come to a rolling boil.
Remove the pan from the heat and stir in the vanilla extract (if using) until well combined.
Pour the hot cream into a clean, dry glass jar and let it cool completely at room temperature.
Cover the jar and refrigerate for 1 to 2 weeks. If the cream is too firm when you take it out, warm it briefly to restore its spreadable texture.