I'm Latvian so I'm using the Latvian keyboard layout.
The thing is that the ' (single quote key) was built a long time ago when computers didn't have native Latvian keyboard support.
Modern layouts use Alt / Opt for accents.
Weirdly enough, macOS uses both options. I only use Opt, but the apostrophe slows me down insanely when writing code. For the accent, I hold Opt to type, but for the apostrophe, it's 2 taps.
Is there a way to disable it without creating a whole new keyboard layout?
Here's a video of how the apostrophe works.