would it be dangerous or lead to unintended consequences to use .data here?

Another major difference between .data and .detach() that you don’t mention here is inplace correctness.
Basically, when we save Tensors because their value is needed to compute the gradients, we have special logic that make sure that it wasn’t modified inplace between the moment where it was saved and the moment where we try to use the value.
.data will break these checks. So even if you use .data on the right hand side of some op that is not used to compute the loss. If you later modify that Tensor inplace and that Tensor was needed for backward, you can end up with wrong gradients because the saved value was changed but the .data hide it from the inplace detection code.