#pip install pikepdf
import pikepdf
pdf = pikepdf.open('filename.pdf', allow_overwriting_input=True)
pdf.save('new_filename.pdf')
#That's if you have it in the same folder. You can make that script more clever. It strips off DRM stuff like printing, copying, editing permissions that are respected by most programs. Probably kills your DRM too.