Is it possible to use some gdal API to call
gdal_translate from Python code? I do not mean simply executing the gdal_translate.py from the file system, but rather call it somehow in code so I do not need to know the exact directory the gdal_translate executable is in?
See the GDAL API Tutorial.
If you want more output control, such as resizing, subsetting, etc... use a VRT as input, this is how gdal_translate does it internally.
I do this with various gdal commands using os.system which you can use to call functions just as from command line:
It's also described in lecture 7 here: http://www.gis.usu.edu/~chrisg/python/2009/
Yes you can call the GDAL Utilities from within Python. There are very minor differences in the approach depending on whether the utility is an exe in its own right or also a piece of python code. Either way though you need to use the subprocess module:
You will notice that I add escaped quotation marks around my paths. This is because, on Windows, I have had trouble with paths, especially ones with spaces or where one of the '\' characters makes another accidental escaped character. So, I just preserve the proper path in aspec as it were.
If you are using one of the python utilities, just do the same thing except your exe at the start of the subprocess command string is now "C:\python32\python.exe" (or whichever version you have) and your second element is the python utility you want to use.
Obviously you can also iterate over your file system rather than using hard-coded constants, but this is just an example.
EDIT - Generalizing for QGIS plugins