I started out in the computer industry working for a company that reverse engineered and built IBM compatible terminal systems, This was more than 40 years ago, when that was its own large and profitable sector of the computer hardware market. It was absolutely legal to build ‘plug compatible’ reverse engineered third party systems. DRM is almost entirely horseshit that has helped turn the entire tech industry into silo’d enshittified monopolies.
Except of course anyone can manufacture and sell plug compatible pipes.