EDIT: pastebin example added
Please post your current version of the script.
In the code you refer to you may try to optimize out some of:
addV1System()
addTargetParams()
addSocketTransport()
calls whenever you call them more then once with the same arguments.
In other words, if among the 4000 hosts you query the only difference is host's address, then the only call you need to repeat is addTargetAddr(). Otherwise you re-configure SNMP engine on every request.
To better estimate pysnmp performance you consider running the following example configured with the 4000 hosts you with to query.
If you would never need SNMPv3 and performance is your priority, you may wish to employ pysnmp's low-level API.
But in any case you would never come close to C implementation in terms of performance. ;-)