Make the pastry dough: Add the flour, salt and sugar to the bowl of a food processor and pulse briefly.
Add the butter, cut into 1 tablespoon pieces and the cream cheese (also cut into pieces) to the bowl and pulse several times, just until mixture starts to come together. Add the vanilla and pulse twice more briefly.
Turn dough mixture out onto a piece of plastic wrap. Bring dough together into a disk, wrap with plastic, and chill for at least 2 hours or overnight.
Make the filling: Peel and core the apples, then cut them into small cubes. Add apples to a saucepan with the butter, sugar, brown sugar, salt, and cinnamon.
Stir apples over medium heat, cooking them until they are just tender. In a small bowl, mix a tablespoon or two of water into the corn starch until smooth. Add cornstarch mixture to the apples and cook, stirring, until mixture starts to thicken.
Remove apples from heat and stir in the optional dulce de leche until well mixed.
Chill apple mixture for at least an hour, stirring occasionally.
Shape empanadas: Roll out dough (in 2 or 3 batches)on floured surface to about 1/4-1/8 inch thickness. Cut circles of dough about 5-6 inches in diameter.
Wet the edge of a dough circle slightly, all around the perimeter. Place 1 scant tablespoon of filling in the middle of the dough. Fold the circle in half, enclosing the filling, and pinch the edges together firmly to seal, flattening and extending them slightly as you pinch them. Fold and crimp the flattened edge over itself decoratively. (see how to fill and shape empanadas. Repeat with remaining empanadas.
Chill empanadas for about an hour for best results (or 15 minutes in the freezer). Preheat oven to 350 degrees. Mix egg yolk with a little bit of water and brush over empanadas. Sprinkle empanadas with sugar.
Bake empanadas until puffed and golden brown, about 20 minutes.
These are best eaten warm, and can be reheated in a low oven.