CookieConsent is a lightweight cookie consent library written in vanilla JavaScript, created by Orest Bida and released under the MIT licence. The library blocks scripts until users consent, offers many configuration options and an API, and supports keyboard and screen reader use. Its makers describe it as GDPR and CCPA compliant with a low performance impact. Documentation, a playground for trying out options and examples on StackBlitz are available. It is a library that you include in your own website rather than a hosted service; the code is on GitHub and is also distributed as an npm package.
Because the code is open source and runs on your own site, no external vendor or cloud platform has to sit in between, and you can inspect and modify the source. The project comes from an individual developer rather than a company. For organisations that want to keep control themselves this is an option, although you handle maintenance and the legal review of the settings yourself.