Mix the popcorn, candy corn, cashews, and gummy worms in a large bowl.
Place the sugar, corn syrup, pumpkin pie spice, and cayenne if using in a medium saucepan. Bring to a boil; cook and stir until the sugar dissolves, about 3 minutes. Stir in the butter until melted.
Pour the hot sugar mixture over the popcorn mixture; toss until coated. Cool before serving.