Always run in a subshell
Instead of requiring the user to run readlinkf_* in a subshell, this allows the natural syntax readlinkf_* "<path>" to be used without changing the calling shell's directory.
Subshell functions are POSIX-compliant:
2.9.5 Function Definition Command ... The format of a function definition command is as follows:
fname ( ) compound-command [io-redirect ...]
2.9.4 Compound Commands ... ( compound-list ) Execute compound-list in a subshell environment... ... { compound-list ; } Execute compound-list in the current process environment...
So the author already answered in pull request https://github.com/ko1nksm/readlinkf/pull/3 that he prioritizes performance over covering broader use cases as he expects the function to be mostly used with command substitution which already spawns a subshell.