I believe those two methods (using requires_grad=False and not giving the parameters to the optimizer) are very similar, if not the same in many cases.
Yes, gradients will accumulate in the frozen layer if you don’t pass the frozen layer’s parameters to the optimizer. The effects of this depends on how the optimizer works; for something like SGD, for each Variable/Parameter, the optimizer subtracts its gradient from its data. In this case, each Variable/Parameter’s update is independent of the others, so the two methods of freezing a layer are equivalent.
If an optimizer uses knowledge about other parameters to update one parameter, then yes, this could be a problem.