Fix bug that causes exponential increase in runtime for formatting of strings with 2 or more {}

This bug causes problems with expressions like:

f = "{} abcdefghijklmnopqrstuvwxyz {}".format("20", "30")

It runs REALLY slow without the  }