(gv-define-setter buffer-string (store)
`(insert (prog1 ,store (erase-buffer))))
Unfortunately, it is marked obsolete since 29.1. The NEWS says: (setf (point-min) 4)
These never caught on and have been made obsolete. The form above,
for instance, is the same as saying (narrow-to-region 4 (point-max)) Passing a nil argument to a minor mode function call now ENABLES
the minor mode unconditionally. This is so that you can write e.g.
(add-hook 'text-mode-hook #'foo-mode)
to enable foo-mode in Text mode buffers, removing the need for
'turn-on-foo-mode' style functions. This affects all mode commands
defined by 'define-minor-mode'. If called interactively, the mode
command still toggles the minor mode.