At least in the EU, the cookie banners aren't mandatory. They're required only if you want to set cookies that aren't necessary, or collect data that isn't necessary.
Technically, the only required data is 'GET / HTTP/1.0', so if you don't throw away all of the bytes after that, perhaps the law applies to you. I don't know, I'm not a lawyer.