This being the view:
"If anyone asserts the fabulous pre-existence of souls, and shall assert the monstrous restoration which follows from it: let him be anathema."
Edited to correct a typo which was causing an inaccuracy.
I think the pre-existence referred to is referring to existence before conception, not to existence before birth.
Aquinas said that the human soul begins to exist when the body does, and while Medieval science might have been a bit uncertain about conception and the stages of embryonic and fetal development, Aquinas did most certainly think that the fetal body was a human body, so he did think that the soul began before birth.
In the linked quote, he speaks against those who thought that any human soul has always existed, and he is also arguing against those who said that it began to exist at some point in time, yet that this existence began befre birth. Now, from the fact that there were persons holding those views which Aquinas is disputing, it is clear that there was some level of diversity of views, so any answer which says that all medieval theologians held the same thing, would likely be an incorrect answer.