The actual problem was just setting the memory limit too low. I wanted 1024MB, but it ended up being 1024KB, so correctly it was:
def main():
resource.setrlimit(resource.RLIMIT_AS, (1024*1024*1024, 1024*1024*1024))
print(requests.get('https://api.github.com').json())
print(subprocess.Popen(['which', 'wkhtmltopdf'], stdout=subprocess.PIPE).communicate()[0])