This is the first in a series of novels by Alan Gordon. The series is set in the 13th century with the premise that there is a Fool's guild whose hidden purpose is to manipulate politics so as to avoid the worst catastrophes and to generally steer events away from war and toward good sense. The series is well written and has a 'realistic' feel despite the odd-sounding premise.
This first novel in the series is, not a re-telling, but an extension, 20 years later, of the Twelfth Night story (brother and sister shipwrecked, brother disguised as woman, prince falls in love with, sister shows up and takes brother's place, thus avoiding great misunderstanding).