You can change some attributes such as the padding directly by setting it in the module as seen here:
model = models.resnet18()
model.conv1.register_forward_hook(lambda m, input, output: print(output.shape))
print(model.conv1.padding)
> (3, 3)

x = torch.randn(1, 3, 224, 224)
out = model(x)
> torch.Size([1, 64, 112, 112])

model.conv1.padding = (0, 0)
print(model.conv1.padding)
> (0, 0)

out = model(x)
> torch.Size([1, 64, 109, 109])

Note however, that changing the padding will also change the output activation shape as seen in the example.
While this approach works in resnet18 due to the usage of adaptive pooling layers before applying the linear layer, you might run into shape mismatches for other models.