How can I speed up serverless invoke local?

I recently upgraded from Serverless Framework v3 to v4, and noticed that sls invoke local -f myFunction has become noticeably slower.

With v3, local invocations were near-instant.
However, after switching to v4, every time I run invoke local, I see a short delay of about 1–2 seconds, during which a message related to authentication is briefly shown.

This happens even when:

  • I’ve already logged in
  • I’m passing SERVERLESS_ACCESS_KEY as an environment variable
  • I’m running the command inside Docker with .serverless mounted

The delay is consistent for every local invocation, even for trivial functions.

To avoid this overhead, I’m thinking of skipping invoke local entirely and directly calling the Lambda handler code during development.
Or is there a way to configure Serverless Framework v4 so that invoke local doesn’t perform any remote authentication or validation on each execution?

I’d prefer to stick with v4 for long-term compatibility, but I’m trying to make local development faster and more lightweight.