Looking at sources on TUHS, it looks like ed had it as early as V5:
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/ed1.s

On Mon, Jul 31, 2023, 10:48 PM ron minnich <rminnich@gmail.com> wrote:
I got to wondering, based on the sendmail discussions, how many shell
escapes have appeared over the years?

uucp
sendmail
xdvi : "The "allowShell" option enables the shell escape in PostScript specials"

There must be a lot of them, however.