Generate a defmacro form that transforms code like this:
(defun-compile-time walk-function-call (map-function reduce-function screamer? partial? nested? form environment) (unless (null (rest (last form))) (error "Improper function call form: ~S" form)) (cond ((lambda-expression? (first form)) (if reduce-function (funcall reduce-function (funcall map-function form 'lambda-call) (funcall reduce-function (reduce reduce-function (mapcar #'(lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment)) (rest form))) (funcall reduce-function (walk-lambda-list map-function reduce-function screamer? partial? nested? (second (first form)) environment) (reduce reduce-function (mapcar #'(lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment)) (peal-off-documentation-string-and-declarations (rest (rest (first form))) t)))))) (funcall map-function form 'lambda-call))) ((valid-function-name? (first form)) (if (symbolp (first form)) (if reduce-function (funcall reduce-function (funcall map-function form 'symbol-call) (reduce reduce-function (mapcar #'(lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment)) (rest form)))) (funcall map-function form 'symbol-call)) (if reduce-function (funcall reduce-function (funcall map-function form 'setf-call) (reduce reduce-function (mapcar #'(lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment)) (rest form)))) (funcall map-function form 'setf-call)))) (t (error "CAR of form ~S is not a valid function" form))))

Pattern to recognize: Macro call that should be transformed by defun-compile-time

Macro definition:
(defmacro defun-compile-time (function-name lambda-list &body body)
  `(eval-when (:compile-toplevel :load-toplevel :execute)
     (cl:defun ,function-name ,lambda-list ,@body)
     (eval-when (:compile-toplevel) (compile ',function-name))))

Macroexpansion:
(eval-when (:compile-toplevel :load-toplevel :execute) (common-lisp:defun walk-function-call (map-function reduce-function screamer? partial? nested? form environment) (unless (null (rest (last form))) (error "Improper function call form: ~S" form)) (cond ((lambda-expression? (first form)) (if reduce-function (funcall reduce-function (funcall map-function form (quote lambda-call)) (funcall reduce-function (reduce reduce-function (mapcar (function (lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment))) (rest form))) (funcall reduce-function (walk-lambda-list map-function reduce-function screamer? partial? nested? (second (first form)) environment) (reduce reduce-function (mapcar (function (lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment))) (peal-off-documentation-string-and-declarations (rest (rest (first form))) t)))))) (funcall map-function form (quote lambda-call)))) ((valid-function-name? (first form)) (if (symbolp (first form)) (if reduce-function (funcall reduce-function (funcall map-function form (quote symbol-call)) (reduce reduce-function (mapcar (function (lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment))) (rest form)))) (funcall map-function form (quote symbol-call))) (if reduce-function (funcall reduce-function (funcall map-function form (quote setf-call)) (reduce reduce-function (mapcar (function (lambda (subform) (walk map-function reduce-function screamer? partial? nested? subform environment))) (rest form)))) (funcall map-function form (quote setf-call))))) (t (error "CAR of form ~S is not a valid function" form)))) (eval-when (:compile-toplevel) (compile (quote walk-function-call))))