How is this an ad? They are informing you that you can get more out of your subscription. Would it be better that they’re didn’t inform you about this and hid it away in some obscure menu somewhere?
There are lots of reasons to not like Google/YouTube, but I can’t see how this is one of them.
Edit: There is also a clearly visible dismiss button.
Being able to handle it, and being able to handle it efficiently enough are two very distinct things. The hash method might be able to handle long strings, but it might take several seconds/minutes to process them, slowing down the application significantly. Imagine a malicious user being able to set a password with millions (or billions!) of characters.
Therefore, restricting it to a small, but still sufficiently big, number of characters might help prevent DoS-attacks without any notable reduction in security for regular users.