But still it is enabled! I can turn it off by evaluating it outside of a hook (smartparens-off).
Also try (add-hook 'gnu-apl-mode-hook 'fundamental-mode) and watch it not work on GNU Emacs 27.0.50
The mode used in the interactive session is called gnu-apl-interactive-mode. The other mode is used for buffers editing .apl files. Can you test by adding your function to that hook instead?
In an attempt to disable smartparens in GNUAPL
But still it is enabled! I can turn it off by evaluating it outside of a hook (smartparens-off). Also try
(add-hook 'gnu-apl-mode-hook 'fundamental-mode)
and watch it not work on GNU Emacs 27.0.50