I'm not sure how much of a deterrent that actually is. Musk hasn't seemed to be bothered too much by violating the law when he felt it served him before.
Musk aside, there's a strong incentive to withhold information that would be self-incriminating for Tesla (or any other company in such situation). Similar situation with accidents - wouldn't the information mysteriously disappear if it suggested car manufacturers fault? Easy to claim that data was unrecoverable in such case, or that some parts are missing..