Two types of squash give this sweet snacking cake incredible moistness and distinctive flavor; pistachios and fennel seeds offer more flavor and contrasting texture.
Preheat oven to 425 degrees. Generously butter a 9-by-5-inch loaf pan. Sprinkle with flour, tapping out excess. Whisk together flour, salt, and baking powder in a medium bowl.
Coarsely grate squash and zucchini on the large holes of a box grater onto a large piece of cheesecloth; gather edges and squeeze out as much liquid as possible.
Spread the pistachios in a single layer on a rimmed baking sheet; toast until fragrant and lightly browned, about 5 minutes. Transfer to a plate to cool.
Using an electric mixer fitted with the paddle attachment, beat butter and sugar on medium-high speed until pale and fluffy. Add the eggs one at a time, mixing until combined after each addition. Beat in vanilla. Add flour mixture, and beat until just combined. Use a flexible spatula to fold in the squash, pistachios, and fennel seeds. Spoon batter into prepared loaf pan.
Bake 10 minutes, then reduce oven temperature to 350 degrees. Continue baking until loaf is golden brown and a wooden skewer inserted into the center comes out clean, about 1 hour. Let cool on a wire rack 10 minutes before unmolding onto rack to cool completely.
Purchase high-quality pistachios, and pick through the nuts for the greenest ones. After roasting, rub the nuts between palms to eliminate as much of the brown skin as possible.