In Tudor England, the only relatively safe way to tell truth to power (to coin a phrase), was to be reliably and consistently amusing about it. Kings, Dukes, dictators and tyrants have been understood to like a good laugh, and to very occasionally tolerate a really good joke at their own expense.
It helped for the longevity of the comedian if he could be excused for his impudence because it could be attributed to a harmless mental disorder.
An elegant modern term for such a repeating disorder might be "brain fart".
College professor and Shakespearean scholar Steve Werkmeister writes an excellent blog about the allowed fool in Shakespeare's Twelfth Night (January 6th), and suggests some contemporary comedians who perform this role.
Some blogs age well. Observations made in June 2016 might seem even more perspicacious in January 2022.
The blog No Sweat Shakespeare offers a self-styled ultimate guide to Shakespeare's fools... and a heavy larding of irrelevant advertisements.
Drew Layton writes a fascinating analysis of a song lyric copyright case (in which the plaintiff did not prevail). The words in a sentence may be identical, but copyright depends on original expression that has been created independently and separately from another work.
The same analysis might apply to jokes.
The defence in the lyric case was very well served because the defendant had kept very good records of his creative process, and had sound recordings of early versions of the song, including experiments with a variety of phrases (beginning with "tell me that...") before settling on the phrase in question.
Titles cannot be copyrighted, for instance, but documenting ones experiments might be a good idea. The same might apply to punchlines.
Intellectual Property attorney Milord A. Keshishian of the Milord Law Group wrote an interesting blog about copyright litigation between an extremly popular comedian (and others), and an author who published a complilation work of other peoples jokes.
The author made the monumental mistake of giving attribution by name to the comedians whose jokes she transcribed, published and distributed without permission.
One might use the search term "compilations of jokes" and find a great many YouTube videos of individuals telling jokes, but beware of appropriating them.
All the best,