The inverse function theorem for curved $L$-infinity spaces