Have a look at https://www.tutorialspoint.com/downloading-files-from-web-using-python
Add layer to map in qgis3 via a python script
As the first part of your question was really about Python -it was important to search without QGIS in your search. The 2nd part was about QGIS but was just about loading data.
The code below is from the two answers above. I am just pointing this out to you as a new user on this platform so that you can get more value from it.
In your case in the python window, it's just
from qgis.core import QgsVectorLayer, QgsProject
# Set variables
url = 'https://www.landesdatenbank.nrw.de/ldbnrwws/rest/2020/data/table?username=LD001583%20&password=N0key1993!&name=19321-108i&area=all&compress=false&transpose=false&startyear=&endyear=×lices=®ionalvariable=®ionalkey=&classifyingvariable1=GEMEIN&classifyingkey1=05766020&classifyingvariable2=&classifyingkey2=&classifyingvariable3=&classifyingkey3=&job=false&Stand=30.06.2019&language=de'
downloaded_file = 'c:/temp/test.txt'
file_name = 'test'
# No more changes required
r = requests.get(url, allow_redirects=True)
#Import data based on url above.
#Add imported data into QGIS
layer = QgsVectorLayer(downloaded_file, file_name, "ogr")
I am not sure what file type the downloaded file is, so just change
test.txt and the path to whatever you need. You may also need to remove the first line or some other parts of the downloaded file to make it into an OGR readable dataset.