Answering because I don't have enough rep for commenting; Try using raw strings instead of the normal ones allowing "\x" escapes. Try:
>>> ctypes.CDLL(r'C:\Program Files (x86)\Java\jre1.8.0_40\bin\client\jvm.dll')
Because the "\..." parts of the string could very well be escapes.