Right now it does not consider the overwrite setting when deciding whether it can use a cached cursor. It kinda works right now because we always use the same setting for all cursors on a given table, but it is a bug waiting to happen. Also, if we start using LSM trees, there are cases where we would want to mix overwrite settings for a single table.
Since overwrite is one of the settings that you can change with WT_CURSOR->reconfigure() we are able to reuse cursors created with the wrong overwrite setting. We should check how expensive it is to just always set it to the desired value on checkout to avoid needing to remember what the old value was. This gets more complicated if we allow changing the overwrite setting for some operations on mongodb-level write cursors in SERVER-55337, so even if it is too expensive at first, it is probably better to work with the WT team to make it cheaper than to avoid calling it.