SteamOS on Steam Deck supports Nix packaging system, besides pacman. pandoc is in the Nix repositories: https://search.nixos.org/packages?channel=25.11&query=pandoc The Nix packaging does not require you to disable read only, as Valve did an exception for this. It should also persist between updates, if I understand this right.
Having said this, i did not ever use the Nix packaging system on Steam Deck (yet). So I cannot assist with advice and have no idea how easy is it to pull off. Here is a random article to set it up once: https://chrastecky.dev/gaming/persistent-packages-on-steam-deck-using-nix The good thing is, once Nix is setup, one can use it for other stuff too.