Here is a different approach, maybe someone will find this useful. This is a minor mode that patches
get-text-property to fake the property
'yank-handler, which indicates which function to use for inserting. Then I use
insert-rectangle for that. That way, this also works with
(defvar my/is-rectangle-yanking nil)
(defun my/insert-rectangle-split (string)
(let ((rows (split-string string "\n"))
(save-excursion (insert (make-string (length rows) ?\n)))
(defun my/get-text-property-rectangle-yank (fun pos prop &optional object)
(let ((propv (funcall fun pos prop object)))
(if propv propv
(when (and (eq prop 'yank-handler) (stringp object) (not my/is-rectangle-yanking))
"Minor mode to yank as rectangle. This patches `get-text-property'
to put `insert-rectangle' as the insert function (`yank-handler')."
:init-value nil :lighter " Rec"
(if (not my/yank-as-rectangle)
(advice-remove 'get-text-property #'my/get-text-property-rectangle-yank)
(advice-add 'get-text-property :around #'my/get-text-property-rectangle-yank)))