human
redirect stdout global.
assistant
Here is a Python function to redirect stdout global

import sys

def redirect_stdout():
    """
    Redirect stdout global
    """
    sys.stdout = open('/dev/null', 'w')

# Enter the string
print("Hello World")

# Calling the function
print((redirect_stdout()))

#Example Output
# Hello World

#Remember to inspect code for bugs.