Here is a frame challenge. The question asks what Cosimo De' Medici (1389-1464) might have done to protect Florence from the Inquisition if Cosimo somehow magically knew ahead of time that the Inquistion would be formed.
For my world, let's assume that Medicis get wind of the inquisition much earlier than in history. With a vast amount of time, could the Medicis prepare and conceal a legal construct, that looks innocuous at the onset but could later be used as a legal shield against the Roman inquisition?
There wasn't "The inquisition".
There were several inquisitions.
The Medieval Inquisition was a series of Inquisitions (Catholic Church bodies charged with suppressing heresy) from around 1184, including the Episcopal Inquisition (1184–1230s) and later the Papal Inquisition (1230s). The Medieval Inquisition was established in response to movements considered apostate or heretical to Roman Catholicism, in particular Catharism and Waldensians in Southern France and Northern Italy. These were the first movements of many inquisitions that would follow.
The Cathars were first noted in the 1140s in Southern France, and the Waldensians around 1170 in Northern Italy. Before this point, individual heretics such as Peter of Bruis had often challenged the Church. However, the Cathars were the first mass organization in the second millennium that posed a serious threat to the authority of the Church. This article covers only these early inquisitions, not the Roman Inquisition of the 16th century onwards, or the somewhat different phenomenon of the Spanish Inquisition of the late 15th century, which was under the control of the Spanish monarchy using local clergy. The Portuguese Inquisition of the 16th century and various colonial branches followed the same pattern.
https://en.wikipedia.org/wiki/Medieval_Inquisition
The questions does mention preparing for the Roman Inquisition of the 16th century and later, so it is aware that the Spanish Inquisition wouldn't be a problem in Italy.
But the Papal Inqiistion was founded in 1231, and so would have already been funcitoning by the time of Cosimo De' Medici. however, it seems to have greatly reduced operations before Cosimo was born.
Thus Inquistor Heinrich Kramer, in an effort to increase Inquisiton business, wrote a book, Malleus Malificarum, first published in 1486, to convince the church authorities that there was a new and terrible heresy which had to be be stamped out, witchcraft. Up until then witches were hardly ever persecuted, and Kramer had been chased out of the Tyrol in 1484 for starting a witchcraft persecution there.
So Cosimo De' Medici would have know that there were Inquisitors searching for heresy in his lifetime, even thoughthey were rather thinly scattered, and Cosimo could have imagined that hypothetical events could cause an increase or decrease in activiies of the Papal Inquisition, without imagining the creation of the Roman Inquistion in the future.