Prepare the tomatoes.
Bring a large pot of water to a boil. Score a small 'X' on the bottom of each tomato and blanch them in the boiling water for 30-60 seconds, until the skins begin to split. Immediately transfer them to an ice bath.
Once cool, peel the skins, then finely chop the tomatoes or purée them in a blender.
In a medium-large saucepan over medium heat, melt the butter.
Add the minced garlic and sauté until fragrant, about 2 minutes, ensuring it doesn't brown.
Stir in the thyme, the puréed tomatoes with their juice, and the salt.
Bring the mixture to a simmer, then reduce the heat to medium-low. Allow the sauce to cook, uncovered, for about 1 hour, stirring occasionally, until it has reduced by half and thickened significantly.
Stir in the red wine and season with black pepper.
Taste and adjust the salt if necessary.
Sprinkle the flour evenly over the sauce and whisk it in vigorously until perfectly smooth.
Simmer for another 5 minutes to cook out the raw flour taste.
For a milder and richer sauce, stir in the optional heavy cream and cook for a few minutes longer until heated through, but do not allow it to boil.