Lightly grease a small glass baking dish. You can use a silicone muffin pan if you want. The shape doesn't really matter.
Place the maple syrup in a medium saucepan and heat over medium heat until it reaches 266°F (130°C). The maple syrup will bubble, and some foam will form; this is normal. While the maple syrup is heating, place the tahini, vanilla extract, and pistachios, if using, in another saucepan and warm over low heat. Tahini must be just warm, not hot.
Once the maple syrup has reached the temperature, turn the heat off and pour the warm tahini into the saucepan. Using a wooden spoon, stir until it thickens and doesn't look shiny anymore. You can use an electric beater if you want but do not beat for too long as it thickens very quickly, about 5-10 seconds.
Pour immediately into the prepared dish and spread it into an even layer. Let cool at room temperature for at least 3 hours before removing from the pan or baking dish.
You can then cut it into small squares or make small chunks using your fingers. Enjoy with coffee, tea, or as an afternoon snack!
Halva will keep stored in an airtight container at room temperature for up to 3 weeks.
Notes
For non-vegans, you can substitute maple syrup for honey. If you don't have access to maple syrup, you can use 2/3 cup cane sugar combined with 2 tbsp water, bring it to a temperature of 248°F (120°C), and then stir in the tahini.
Halva flavors
"Nutella": Combine 1/4 cup tahini, 1/4 cup hazelnut butter, 1/2 tsp vanilla extract, and 1 tsp cocoa powder.
Pecan Cinnamon: In a small bowl, coat 1/4 cup pecans with 2 tsp maple syrup, 1/4 tsp oil, and 1/8 tsp cinnamon. Roast for 8 minutes at 350°F (175°C). Add the roasted pecans and 1/4 tsp cinnamon to the tahini.
Chocolate Marble: Melt 3 tablespoons of dark chocolate chips over a double boiler. Prepare the halva as explained above. Stir in the melted chocolate after combining the tahini with the maple syrup. Refrain from stirring too much to keep a nice chocolate swirl.
Peanut: Combine 1/4 cup tahini, 1/4 cup peanut butter, 1/4 tsp vanilla extract, and 1/4 cup roasted peanuts.