ummm... yeah.
you could use the command prompt to write and compile code:
example
(my C compiler is called tcc, it's just a more lightweight version of gcc)
Code:
C:\Users\me\Desktop>echo #include^<stdio.h^> > Test.c
C:\Users\me\Desktop>echo void main() >> test.c
C:\Users\me\Desktop>echo { >> test.c
C:\Users\me\Desktop>echo printf("helloworld"); >> test.c
C:\Users\me\Desktop>echo } >> test.c
C:\Users\me\Desktop>tcc test.c
C:\Users\me\Desktop>test.exe
helloworld
C:\Users\me\Desktop>
the question rather becomes... why would you?
I suppose if you were faced with a editorless terminal you might copy line by line into a file the source code to give you a basic editor.
but why not just use notepad if you don't want a real IDE.
or I can recommend a program called Turbopad (does context highlighting and has nothing else associated with an IDE)
you're still going to need something like Tcc or Gcc to actually compile the source though.
and if you made a mistake it'd be a real pain in the rear to fix it.
of course, my example is in C, but it's exactly the same with python, you can write plain text to a file and then do whatever you like with it after that!