Preheat the oven to 350°F. Grease two 8-inch round cake pans and line the bottoms with parchment paper.
Add the pistachios and 2 tablespoons of the flour to a food processor and pulse until finely ground, like coarse sand. Transfer to a medium bowl and whisk in the remaining flour, baking powder, baking soda and salt.
In a large bowl, whisk the milk, yogurt and sugar until the sugar mostly dissolves. Whisk in the oil, melted butter, vanilla, almond extract and food coloring, if using, until smooth.
Add the dry ingredients to the wet mixture and fold gently with a spatula just until combined, with no dry pockets left. Divide the batter evenly between the pans and smooth the tops.
Bake for 25-30 minutes, until a toothpick inserted in the center comes out clean. Cool in the pans for 10 minutes, then transfer to a wire rack and cool completely.
For the frosting, beat the mascarpone, powdered sugar and vanilla on low for 30 seconds until smooth. Pour in the cold heavy cream and beat on medium high for 2-3 minutes, just until stiff peaks form.
Place one cake layer on a serving plate, spread with a thick layer of frosting and top with the second layer. Frost the top and sides, then sprinkle the chopped pistachios over the top and gently press some onto the sides.Chill for 30 minutes before slicing, and store any leftovers in the fridge.