Combine the starch and sugar. In a medium saucepan, whisk together the cornstarch (or arrowroot starch) and coconut sugar until evenly combined. This helps distribute the starch throughout the sugar and prevents lumps from forming in the custard.
Add the milk and cream. Slowly pour in the whole milk and heavy cream, whisking continuously until the mixture is smooth and the starch and sugar are fully incorporated.
Add the chocolate. Stir in the chocolate chunks or gems. Make sure the chocolate is evenly distributed throughout the mixture.
Cook the chocolate filling. Place the saucepan over medium heat and cook for about 2 minutes, whisking frequently, until the mixture begins to bubble and thicken. Once bubbling, reduce the heat to low and continue cooking for another minute, whisking constantly. The filling should begin to resemble a thick chocolate pudding.
Prepare the egg yolks. Remove the saucepan from the heat. Separate the eggs, placing the yolks in a small bowl. Whisk the egg yolks until smooth and combined.
Temper the egg yolks. Slowly add about 1 cup of the warm chocolate mixture to the egg yolks, a little at a time, whisking continuously. This process gently warms the yolks so they can be incorporated into the hot filling without scrambling.
Finish cooking the custard. Pour the tempered egg mixture back into the saucepan with the remaining chocolate filling. Return the pan to the stove over low heat and cook for another 2 minutes, whisking constantly. The filling should become thick, smooth, and glossy. Avoid bringing it to a boil.
Add the butter and vanilla. Remove the saucepan from the heat. Whisk in the salted butter and vanilla extract until the butter has completely melted and the filling is silky and smooth.
Fill the pie crust. Pour the warm chocolate filling into your prepared, pre-baked gluten-free pie crust or cooled graham cracker crust. Use a spatula to spread the filling evenly and smooth the top.
Cool the pie. Place a piece of wax paper directly over the surface of the chocolate filling to help prevent a skin from forming. Allow the pie to cool at room temperature until it is no longer warm.
Chill before serving. Transfer the pie to the refrigerator and chill for at least 2 hours, or until the filling is completely set. For the cleanest slices, I recommend chilling it a little longer if you have the time.
Make the whipped cream and serve. Serve chilled with homemade whipped cream lightly sweetened with maple syrup and vanilla extract. The lightly sweetened whipped cream is the perfect complement to the rich chocolate filling!