AFAIK there are already laws about reverse-engineering for compatibility. May extend that and add something like the right to repair, so the ones who sell software or software services also have to provide documentation and more access to the actual features.