From Rec. 2020 wikipedia article: Since a larger color space increases the difference between colors an increase of 1-bit per sample is needed for Rec. 2020 to equal or exceed the color precision of Rec. 709.
The "correct" solution is to use a modern colorspace (rec 2020) with 10 bits encoding (or 12 bits, if you can). UHD standard mandates at least 10 bits.
On the '821 you could gain 1 bit by degrading to an older color space - 709.
Full 0-255 range should never be used - they are invalid according to the standard. None of the hardware codecs are validated for 0-255 - you're asking for trouble here. Expect ghosting and weird motion artifacts accumulating from one I-frame to the next I-frame.
YT and other platforms have no problem ingesting these videos. Also the RPi Broadcom chipset does not seem to care.
Let's say I have a video with full RGB range 0-255 video. Why would 10-bit be a better option than 8-bit?
If you have enough control over the decoder and renderer to make that hack work, you should just be producing 10-bit HEVC/AV1 video – which does not suffer from these 8-bit banding issues – with a modern color space (Rec 2020, PQ, etc.).
And if you don't have choice or control over the decoder and renderer, then it's a good sign that this would be a fragile hack.