You could remove the bias from the linear layer or alternatively multiply the output with a mask.
What is you use case that you would like to pass a sample with all zeros and expect an all-zero output?