Preheat your oven to 350°F. Line rimmed baking sheets with unbleached parchment paper and set them aside.
Make the cookie dough.
In a large bowl, place the flour, xanthan gum, baking powder, salt, granulated sugar and confectioners’ sugar, and whisk to combine well. Add the butter, eggs, vanilla, and optional peppermint, and mix to combine. The dough will be thick and smooth.
Divide the dough into two equal pieces. Wrap one piece in plastic wrap and set it aside.
Place the other half of the dough on a piece of parchment paper or plastic wrap, and add about 1/8-teaspoon of the red gel food coloring. Knead in the food coloring until the color is uniform throughout the dough. Divide each half of cookie dough into teaspoon-sized pieces of dough, about 10 grams each. Roll each piece of dough tightly into a ball, and cover the balls of dough with plastic wrap to prevent them from drying out as you shape the cookies.
Shape the cookies.
Working with two pieces of each color of cookie at a time, roll each ball of cookie dough into a rope about 4-inches long. Pair together one plain rope and one red rope along the length of each, and press together carefully but firmly so they adhere lightly to one another.
Holding the now-doubled rope at each end, twist the rope in opposite directions to twirl the ropes. About 3 turns should do it—don’t go overboard or the dough may crack or tear. Bend one end of the twisted rope into a hook so it resembles a candy cane.
Repeat with the other pieces of dough, and place about 1-inch apart from one another on the prepared baking sheets.
Repeat with the remaining dough of each color.
Bake the cookies.
Place the baking sheets in the center of the preheated oven, one at a time, and bake until the cookies are puffed and just beginning to brown around the edges (about 10 minutes). Remove from the oven and allow to cool completely on the baking sheet.