Position a rack in the center of the oven and heat the oven to 350F. Line a 8-inch square baking pan (I like the straight-sided kind) with foil or parchment paper, leaving about a 1-inch overhang on two sides. Lightly grease the foil
Cut the butter in half lengthwise and then cut each strip into 6 pieces. Pile onto a plate and slide into the freezer until ready to use.
Put the egg and vanilla in a ramekin or small bowl and us a small fork to mix until blended. Put the flour, sugar, baking powder, and salt in a food processor. Process until blended, about 2 seconds. Scatter the chilled butter pieces over the flour mixture and pulse until the mixture forms coarse crumbs and the butter is in very small pieces. Drizzle the egg mixture over the flour mixture, then pulse just until the dough forms moist crumbs and the butter is incorporated, about 20 seconds. Remove the dough from the bowl and divide in half.
Scatter half of the dough in the prepared pan and, using lightly floured fingertips if necessary, pat it down into the bottom and corners of the pan to make a even layer. Using a spoon or small offset spatula, spread the strawberry jam evenly over the dough. Add the walnuts (if using them) to the remaining dough and, using fingers, mix and gently pinch the dough until it forms crumbles (there will be some big crumbles but mostly small). Scatter the crumbles evenly over the jam.
For a soft texture, bake until the top is pale golden, 36-38 minutes. For a crunchy texture, bake until the top is golden brown and the jam is bubbling around the edges, 40-42 minutes. Move the panto a rack and let cool completely.
To cut, use the foil on the sides of the pan to lift the cookie from the pan. carefully peel away the foil from the sides and set the cookie on a cutting board. Using a ruler as a guide and a serrated knife, cut crosswise in 4 equal strips and then cut each strip into squares (about 2 inches). I use a gentle sawing motion to break through the top crust and then firmly push down the knife. Dust lightly with confectioners' sugar just before serving or melt semi-sweet chocolate and drizzle over squares before serving, if desired.