GNOME has had built-in support for mapping a key to be either AltGr or Compose since at least the 2.X days. I imagine most other DEs do as well. Settings > Keyboard > Special Character Entry
I use this to set the Print Screen key on my ThinkPad (two keys right of spacebar) to be a compose key.
