How to hide developer option from setting except with clear data or factory reset on android 8.1.0?
You can clear the settings through an adb shell. That should hide the developer settings to make it like them hidden like before you enabled them:

adb shell pm clear com.android.settings