REAPER always gives a non-NULL string to 'const char*' optional arguments of extension functions, even if the caller omitted them or passed nil/0. This prevents distinguishing between omitted vs empty strings and providing a non-empty default.
int and double optional args can receive NULL as expected.
Code:
plugin_register("APIdef_Test", "bool\0const char*\0strInOptional\0\0");
bool Test(const char* strInOptional)
{
return strInOptional != NULL;
}