I'm starting to think a custom LD_LIBRARY_PATH might be the least awful way of using jpegli.
Overwriting system libjpeg with a custom-built .so sounds insane to me. Creating a static binary specifically for the project that needs it involves unmaintainable magic build system incantations for 10+ dependencies.
I suppose there's Nix or Guix, but I'm too old to be learning new tricks.