Preheat the oven to 325 degrees F (165 degrees C). Spray a 9x5-inch loaf pan with cooking spray. Mix butter and sugar in a large bowl until light and fluffy. Whisk in eggs one at a time until combined. Whisk in the pumpkin puree, cinnamon, Chinese five-spice powder, and allspice until combined. Stir flour, salt, baking powder, and baking soda into the pumpkin mixture and mix until just combined. Stir in chopped walnuts. Pour batter into the prepared loaf pan. Bake in the preheated oven until a toothpick inserted into the center comes out clean, about 1 hour.