Sure, we could roll our own but that creates its own problems and doesn't exempt you from cookies notices at all.
As a user, I don't want to be spied on so that you can "improve" your product aka make it more addictive or refine your dark patterns. I definitely don't want Google spying on me to help you achieve that goal either.
The GDPR making it harder for you to do this means it's working as intended and I'm very glad to have it as a user.
Sorry to tell you, but it actually does.
Cookie notices are only necessary when you are transferring data to third-parties and there's no technical reason for that.
Selling my personal data to some analytics company, and you have chosen to do exactly that, is not technically neccessary but a very deliberately made decision by someone.
They could just run their own analytics tool and you wouldn't need any notice at all for basic visitor counting. But everybody is craving for that shiny numbers from Google Analytics (for mysterious reasons _perfectly_ integrated into all other Google tools), easy ad money and whatever metric marketing wants to see this month.