Here is a simple example of a string variable in the API, where it's converted to a boolean.
Another example where a date string is converted to an actual datetime attribute:
Let me know if you have any other questions!
Depending on how often the rest service is called, it shouldn't be too big of an issue. Once you are done with a non-persistent entity the garbage collection will remove it from memory.
If you want to improve your performance you can set the import mapping method to call a microflow instead of creating an object. That way you can import the json to your second data structure.
Here is some documentation that talks about it
Edit: If you double click the grey entity in your mapping, it will open up the properties and this is where you can define this method.