Vinegar is a Safari extension that replaces the YouTube player with a minimal HTML video tag.
It removes ads, restores picture-in-picture, and allows videos to play in the background when set to audio-only quality.
Note: The phrase 'can read and alter webpages' in the permissions section is just an unfortunate choice of words. Vinegar needs access to the webpage to find the YouTube player and replace it. It's not doing anything creepy!
(Also, do check out Vinegar's companion app, Baking Soda. It's essentially a less powerful version of Vinegar, but it works on all websites except YouTube.)