The lock around instantiating custom types is really expensive

Don't take that code-path if there are no registered custom types.