Hi,
I sadly don't have a reproducer at hand, but this is something I see somewhat regularly in my Emacs 30.1 (and before that, in Emacs 29 as well); sometimes just pressing RET (enter) without any command triggers it in M-x shell, like just occurred:
maxim@terra ~/src/opendht$
==emacs==ret=0==.
==emacs==ret=0==.
==emacs==ret=0==.
Looks like a single RET caused the problem. I wasn't in any guix shell or otherwise special environment.