I think you want ctx.mark_non_differentiable.
It does not, however, spare you from taking a second grad_out argument in the backward even if it will be all zero (and indeed fully materialized at the moment):
class MyFunction(torch.autograd.Function):
    @staticmethod
    def forward(ctx, inp):
        out2 = inp * 3
        ctx.mark_non_differentiable(out2)
        return inp * 2, out2
    @staticmethod
    def backward(ctx, grad_out_1, grad_out_2):
        return grad_out_1 * 2

Best regards
Thomas