You can print an ANSI escape code that will clear the console this way:
print("This message won't be visible.")
print("The console was cleared.")
var escape = PoolByteArray([0x1b]).get_string_from_ascii()
print(escape + "[2J")
Keep in mind this won't work in the editor's Output tab, as it doesn't interpret ANSI escape codes. See this Stack Overflow question for more information on clearing/resetting a console using ANSI escape codes.