Put a cookies.txt (or json or xml or whatever) at the root of the website (or use a <link> element) with the name of the cookie and what it does. If the cookie isn't listed, the browser rejects it.
The GDPR is not inherently about cookies, and it also does not stand in the way of the solution you describe.
What is standing in the way is corporations considering it more profitable to hassle their users with antipattern-laden popups than to follow the spirit (and, ostensibly, letter) of the law.