Sift the almond flour and powdered sugar together. Divide the mixture evenly between two bowls. Add the cocoa powder to one bowl and leave the other bowl plain.
Beat the egg whites at medium speed until foamy. Add the cream of tartar, then gradually add the granulated sugar. Whip until stiff, glossy peaks form, then mix in the vanilla extract and optional gel food coloring.
Divide the meringue evenly between the two bowls of dry ingredients.
Gently fold each mixture with a silicone spatula until the batter flows slowly in a thick ribbon and settles back into the bowl within 10 to 15 seconds.
Transfer each batter to a separate piping bag fitted with a round tip. Pipe evenly sized circles onto lined baking sheets.
Tap the baking sheets firmly against the counter to release air bubbles. Pop any remaining bubbles with a toothpick.
Leave the piped macarons uncovered at room temperature for 30 to 60 minutes, until the surfaces feel dry and do not stick when gently touched.
Preheat the oven to 300°F (150°C). Bake one tray at a time for 14 to 16 minutes. Let the shells cool completely before removing them.
For the vanilla buttercream, beat the softened butter until creamy. Gradually add the powdered sugar, vanilla, salt, and enough heavy cream to make a light, pipeable filling.
For the chocolate ganache, pour the hot heavy cream over the chopped chocolate. Leave for 2 minutes, then stir until smooth. Add the optional butter and let the ganache thicken.
Pair the cooled shells by size. Fill the vanilla shells with buttercream and the chocolate shells with ganache. Gently sandwich them together.
For the best texture, refrigerate the filled macarons in an airtight container for 24 hours. Bring them to room temperature for about 20 minutes before serving.