Preheat oven to 375°F. Line a baking sheet with parchment paper and position the oven rack in the center.
In the bowl of a stand mixer fitted with the paddle attachment, or in a large bowl with an electric mixer, combine the ¾ cup room-temperature unsalted butter and 3½ cups room-temperature shredded cheddar cheese. Beat on medium speed about 2 minutes, until the mixture is evenly combined and slightly fluffy.
Add the heaping tablespoon of finely chopped fresh rosemary and mix on low just until distributed.
In a separate medium bowl, whisk together 2 cups all-purpose flour, ¼ teaspoon cayenne pepper (if using), 2½ teaspoons granulated garlic, and ¾ teaspoon fine sea salt.
With the mixer on low, gradually add the flour mixture to the butter–cheese mixture. Mix just until a soft dough forms, stopping once or twice to scrape down the bowl sides with a spatula. Do not overmix.
Lightly flour a work surface and turn the dough out onto it. Using a rolling pin, roll the dough into a rectangle about ½ inch thick. If the dough sticks, dust lightly with flour as needed.
Use a pizza cutter or sharp knife to cut the dough into strips about ½ inch wide. Transfer the strips to the prepared baking sheet, spacing them about 1 inch apart.
Bake in the preheated oven 12–14 minutes, or until the edges are golden and the straws are crisp. Remove from the oven and let cool on the baking sheet a few minutes, then transfer to a wire rack to cool completely before serving.