In his first post, Menahem Mendel wrote about the medieval Ashkenazic exemption of scholars from payment of communal taxes. He compares this to a colonial American law that allowed clergy to escape the death penalty by reciting a biblical passage.
I have noticed a couple of instances where medieval Ashkenazic scholars found themselves embroiled in court proceedings, and used their Talmudic expertise to maintain a controversial position beneficial to themselves. The examples that come to mind are R Ya'akov Sevara of Krakow (not mentioned here, though he is apparently the first Polish rabbinic figure known by name), who married a woman who had recently given birth, and R Yoel ha'Levi of Bonne (in a case discussed recently by Brigit Klein, Zutot 3 , 121-134).
But those rabbis did not exert any special influence, or receive any preferent treatment from the court. In fact, they lost (at least, R Ya'akov did. I don't remember the outcome of the R Yoel case), with tragic consequences (great material for a novel, which I once tried to write but realized my shortcomings).