Is there a way on Android 6.0 to switch to charging only before plugging my phone into an USB?
Enable developer options - To enable Developer Options, go to Settings and select About phone. Now, scroll down and find out Build number. Tap on this option around 7 times. You will get a success message
You will find Select USB configuration . Tap on that too open a sub menu and choose Charging only
Next time you connect, it will revert to charging automatically
Yes there is. I just did this right before updating to 7.0 so I hope I am remembering right. If you go to your developer options there should be an option to turn on or off what happens when you plug in your phone to a usb cord connected to a computer. You can switch it to charge only if you want. My current computer auto-encrypts anything plugged into it so I had to dig for this option. If it isn't in the Developer options, its in the USB connection options. Sorry I couldn't be more help.