Check with_kwargs before we check isinstance first

Checking booleans is presumably faster than checking isinstance.