Preheat oven to 375°F. Line a baking sheet with parchment paper.
In the bowl of a stand mixer fitted with the paddle attachment, or in a large bowl with an electric mixer, beat the ¾ cup unsalted butter and 3 ½ cups cheddar cheese on medium speed about 2 minutes, until smooth and combined. Add 1 heaping tablespoon finely chopped fresh rosemary and mix briefly to distribute. Scrape down the bowl and paddle as needed.
In a medium bowl, whisk together 2 cups all-purpose flour, ¼ teaspoon cayenne pepper (if using), 2 ½ teaspoons granulated garlic, and ¾ teaspoon fine sea salt until evenly combined.
With the mixer on low, add the flour mixture to the butter-cheese mixture in 2–3 additions, mixing just until a soft dough forms and no large streaks of flour remain. Stop to scrape the bowl as needed.
Lightly flour a work surface. Turn the dough onto the surface and gently press or knead it just until it comes together into a cohesive rectangle. Use a rolling pin to roll the dough to 1/2-inch thickness.
Use a pizza cutter or sharp knife to cut the dough into strips. Transfer the strips to the prepared baking sheet, spacing them about 1 inch apart.
Bake on the center rack for 12–14 minutes, or until the cheese straws are crisp and lightly golden.
Remove from the oven and transfer the cheese straws to a wire rack to cool before serving.