pacman allows you to install packages with the option --asdeps to mark them as dependencies.
This is useful for optional dependencies as pacman can then recognize them as orphans when the packages that optionally required them are removed.
Supporting this flag might also help with the limitations mentioned in the README.