While not at guaranteed, killing the data wires (or shorting them) makes the device think it is dealing with a charge only port.
Thus various companies have made devices that conditionally apply said short.
Here is one example: https://www.startech.com/Cables/USB-2.0/USB-Adapters/USB-2-F...