Drew's answer correctly identifies the source of the error message, but there are some additional problems with the code.
(defun yasm-calculate-indentation (oldfun)
"Add the formatting for a few other keywords I like."
((looking-at-p "section") 0) ; section
((looking-at-p "global") 0) ; global
((looking-at-p "extern") 0) ...
(advice-add :around #'asm-calculate-indentation #'yasm-calculate-indentation)
(advice-add #'asm-calculate-indentation :around #'yasm-calculate-indentation)
C-h f advice-add says:
advice-add is a compiled Lisp function in `nadvice.el'.
(advice-add SYMBOL WHERE FUNCTION &optional PROPS)
Like `add-function' but for the function named SYMBOL....
The problem isn't that no Magit buffer exists but rather that Magit has not even been loaded. The result is that Symbol’s function definition is void: magit-after-save-refresh-status.
So you have to delay adding this function to the hook until it actually exists, like so:
(add-hook 'after-save-hook 'magit-after-save-...
No need for a macro, all you need is a function doing a loop:
(defun add-hook-x (hook &rest functions)
(dolist (function functions)
(add-hook hook function)))
There isn't really a need for this either once you realize that you can bundle all these functions added to the hook into a single function:
(defun my-go-mode-setup ()