Heat 1 tbsp butter over medium-low heat in small pan. Add onion and cover. Cook 20 minutes. Remove lid and increase heat to medium high. Cook until browned, stirring frequently, about 10 minutes. Add in 2 cloves garlic and cook 1 minute.
Meanwhile, cut remaining 12 tbsp butter into 12 pieces. Place flour and 1/4 tsp salt in a large mixing bowl. Add in butter and mix in using your fingers until dough looks like small peas. Add 1 egg and mix. Add ice water 1 tbsp at a time until dough pulls together and can be formed into a ball. Cover with plastic wrap and return to fridge for 20 minutes.
Preheat oven to 350. Mix together cheese, onions, dried parsley, dried basil, 1/2 tsp chili flakes and remaining 1 tsp salt to form the empanada filling.
Separate remaining egg into egg white and yolk.
Roll out the dough as thinly as possible on a floured surface. Using a small plate as a guide, cut circles of dough about 3-4” diameter.
Fill each circle with 1-2 tbsp cheese mixture and wet the outer edges of the dough circle with egg whites to help them seal. Push them edges together with your finger and use a fork around the whole side to seal them together. Place on greased baking sheet in fridge for 20 minutes.
Mix together shallot, 1 clove garlic, cilantro, parsley, vinegar, olive oil and 1/2 tsp chili flakes to form sauce and set aside.
Whisk egg yolk and brush tops of empanadas with yolk. Bake for 25-30 minutes, until golden. Serve with chimichurri sauce.