It appears a simple registry key hold the information, here a simple function to query the developer mode status.
bool IsDeveloperModeEnabled() {
HKEY hKey;
auto err = RegOpenKeyExW(HKEY_LOCAL_MACHINE,LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock)",0,KEY_READ,&hKey);
if (err!=ERROR_SUCCESS)
return false;
DWORD value{};
DWORD dwordSize = sizeof(DWORD);
err = RegQueryValueExW(hKey,L"AllowDevelopmentWithoutDevLicense",0,NULL,reinterpret_cast<LPBYTE>(&value),&dwordSize);
RegCloseKey(hKey);
if (err!=ERROR_SUCCESS)
return false;
return value != 0;
}