As long as it is over HTTPS and you trust the author, it shouldn't be any different than downloading and running an arbitrary binary from a website.
As legitimate websites of software have been breached to serve infected packages (like CCleaner[1]) or otherwise fraudulent content (even kernel.org[2]), I always shudder a bit, when I see being asked to pipe something directly from curl to a (root) shell.
1. https://www.extremetech.com/internet/256238-ccleaner-infecti...