If the text takes only one line you can use the clrtoeol
function to erase the whole line starting from the cursor:
curses.setsyx(y, 0) # beginning of the correct line
# stdscr.move(y, 0) # alternative
stdscr.clrtoeol() # clears the current line
Alternatively you can use the hline
function to insert a whole line of whitespace:
stdscr.hline(y, 0, ord(' '), 80) # where 80 is the width of the screen