To make the crust, mix butter, sugar, salt, vanilla, and pecans (if using) in a medium bowl. Add flour and mix until just blended. Press the dough evenly over the bottom and up the sides of a 9 1/2-inch tart pan with a removable bottom. Bake in the lower third of an oven preheated to 350° F until the crust is pale golden, about 20 to 25 minutes.
Meanwhile, make the filling. Combine butter, sugar, cocoa powder, and cream in a medium saucepan. Stir over medium heat until mixture is blended and smooth and begins to simmer around the edges. Remove from heat and stir in espresso powder and vanilla.
Just before the crust finishes baking, add beaten egg to the cocoa mixture, whisking until well combined.
Pour the filling into the hot crust and turn off the oven. Leave the tart in the oven until it quivers slightly in the center when the pan is nudged, about 10 to 12 minutes. Cool on a rack.
If desired, add a decorative pattern to the tart; sprinkle the top with cocoa powder, cover with a doily or handmade snowflake, and then sprinkle with powdered sugar. Remove paper carefully and serve.