Just a follow up:
It is possible to do it with a cond-expand, as the gerbil compiler can detect when it is compiling with (not safe).
The contract check in the generated code would be at the function entry point and look like:
(cond-expand
(gerbil-runtime-checks
...) ;; do checks and raise exception if the contract is violated
(else))
When the compiler detects that it is in a safe context (absence of a local or prelude (not safe) declaration), then it
can emit a (define-cond-expand-feature|gerbil-runtime-checks|) for gsc, and compile in the contract checks.
This is a reasonably good solution, so there is no pressing need to add a construct to gambit that conditionally compiles based on declarations.
-- vyzo