komootgpx creates a GPX from Komoot, even if you don't have the region unlocked. It uses the data used to draw the map, and then puts that into a GPX directly.
cargo install komootgpx
By default the GPX is written to stdout, but you can also put it in a file. For example:
komootgpx 'https://www.komoot.com/smarttour/15628660' -o stockholm-loop.gpx