The documentation of FLAC__stream_encoder_set_compression_level claims that the default compression level is 5. And indeed, this seems to be the case in the code: FLAC__stream_encoder_new calls set_defaults_, which calls FLAC__stream_encoder_set_compression_level with the level 5. Unfortunately this call does absolutely nothing, because the function starts with a check:
if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED)
return false;
And at this point, encoder->protected_->state is zero, which corresponds to FLAC__STREAM_ENCODER_OK. This zero comes from the calloc used to initialize encoder->protected_ — state is only set to FLAC__STREAM_ENCODER_UNINITIALIZED at the very end of FLAC__stream_encoder_new, which is too late for this attempt to set the compression level.
The default compression level is thus apparently even below the normal zero compression level: all other settings are equivalent to the normal zero level except for max_residual_partition_order, which is 3 in the zero level but 0 after FLAC__stream_encoder_new.
As far as I can tell, this bug has been there "forever" — ever since the documentation stating that the default level is 5 was added, which was way back in commit 425609cb0cbbc260a43109fecebcd339e7039fc7 on 2006-11-03. The call to FLAC__stream_encoder_set_compression_level was introduced a few years later, in commit a832ef32fb2a888674659097f40c1f8efb72c1a4 on 2009-01-02, but it had no effect even then. The status quo does not seem to have changed since.
Patch is here: https://github.com/xiph/flac/pull/294