Melt the butter in a large pot over medium heat, and cook until it turns nut brown. Add the leeks and cook until slightly softened, about 2 minutes. Add the garlic and saute briefly to release its fragrance.
Add the squash and apples, raise the heat to high, and cook, stirring, until the vegetables begin to caramelize, about 5 minutes. Stir in the Toasted Spice Rub and cook briefly to toast it, about 1 minute.
Add the stock or broth-water mixture, bring to a simmer, and partially cover. Adjust the heat to maintain a gentle simmer and cook until the squash and apples are tender, about 40 minutes.
Transfer in batches to a blender or food processor and blend until smooth. Return to the pot, reheat to serving temperature, and season with salt.
Divide the soup among warmed bowls and garnish each portion with some of the walnuts, if using. Serve immediately.
Toasted Spice Rub:
In a small heavy pan over medium heat, combine the fennel seeds, coriander seeds, and peppercorns. When the fennel turns light brown, work quickly. Turn on the exhaust fan, add the red pepper flakes, and toss, toss, toss, always under the fan. Immediately turn the spice mixture out onto a plate to cool. Put in a blender with the chili powder, salt, and cinnamon and blend until the spices are evenly ground. If you have a small spice mill or a coffee grinder dedicated to grinding spices, grind only the fennel, coriander, pepper, and chili flakes. Pour into a bowl and toss with the remaining ingredients.
Yield: about 1 cup
Spiced Candied Walnuts:
In a large, heavy-bottomed skillet, heat about 1-inch of oil to 350 degrees F.
Bring a large pot of water to a boil. Add walnuts and blanch for 30 seconds. Drain and transfer nuts to a medium bowl. While nuts are still hot and slightly wet, add confectioners' sugar and toss to coat nuts. Stir and toss until all the sugar has melted into the nuts; if bits of unmelted sugar remain on the nuts, they will not fry properly.
Stir the nuts again before frying. Using a large slotted spoon, transfer a few nuts to the hot oil, allowing the foam to subside before adding another spoonful. (Otherwise, the oil could foam over and burn you.) Fry in small batches until the nuts are medium brown, about 45 seconds per batch; be careful not to overcook. Scatter on an unlined baking sheet to cool slightly.
In a small bowl, stir together cayenne, cinnamon, a pinch of salt, and the pepper.
While the nuts are still warm, transfer them to a bowl and sprinkle evenly with about half of the spice mix. Toss well to distribute the spices and then taste a nut. Add more spice mix, to taste, and toss well after each addition. When cool, pack in an airtight jar. They will keep at room temperature for at least 2 weeks.