I don’t know about Defold built in functions. This is for sure possible to do natively. Maybe extension system would allow the use of native functions which enable it. Or it could be added to the window module. Like window.lock_orientation(window.ORIENTATION_PORTRAIT)
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
Does sys.get_sys_info know how to detect iPads vs iPhones? If not you could also do it based on resolution. There are only a small number of possible resolutions, and then could set portrait or landscape orientation lock depending.