After executing (python-shell-send-buffer) my point does not return to
the mark but the beginning of the buffer. I am able to reproduce this
behavior on "emacs -Q" (my emacs is "GNU Emacs 30.0.50 (build 11,
x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of
2023-02-14"). I wrote a wrapper function like this
(defun site/python-shell-send-buffer ()
(interactive)
(save-excursion
(python-shell-send-buffer nil)))
which works as desired (??).
Please see
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61463
it could be the same issue. If it is, you will find a patch there.