You should reorganise your code thus:
def SignUp_login(welcome):
def mainmenu():
status = False
for i in range(3): // only try this a fixed number of times
welcome = input("\n1. SignUp \n2. Login \n\n")
status = SignUp_login(welcome)
if status == True:
break
while status == True:
mainmenu()