Not offhand, but I looked it up and I think what you want is `key-description'. It prints key sequences, so e.g. (key-description "\370") evals to "M-x".
This should do what the original commenter wanted:
(defun insert-keybinding (k)
"Insert code for a keybinding."
(interactive "kKey sequence: ")
(insert (concat "(global-set-key (kbd \""
(key-description k)
"\") 'function-name)")))