For Music, the solution is to start it while holding down Option, create a new temporary library, quit, restore the old one, restart Music while holding down Option again, and then select the restored one; you can delete the temporary one at this point. For photos I'm pretty sure a similar dance will work. (Remembering of course to disable iCloud Photos first, and to set the System Photo Library at the end <https://support.apple.com/en-us/104946>)