Set rotation values without applying them
Here's a script which does this, comments inline.

import bpy
import math

#target rotation:
target_rotation = [90, 90, 90]
#object to operate on (active object):
ob = bpy.context.active_object



#this assumes you are starting at 0 rotaton, so you pobably want to apply rotation before doing anything:
bpy.ops.object.transform_apply(location=False, rotation=True, scale=False) #apply rotation
#get inverse of rotation we want:
t_rot = (math.radians(target_rotation[0]*-1),
         math.radians(target_rotation[1]*-1), 
         math.radians(target_rotation[2]*-1))
#we need to apply the rotations in reverse order, so unsure that we are in zyx:
ob.rotation_mode = 'ZYX'
ob.rotation_euler = (t_rot) #set rotation to inverse
bpy.ops.object.transform_apply(location=False, rotation=True, scale=False) #apply rotation

t_rot = (math.radians(target_rotation[0]),
         math.radians(target_rotation[1]), 
         math.radians(target_rotation[2]))
ob.rotation_mode = 'XYZ' #set rotation mode back (was zyx, so we want xyz)
ob.rotation_euler = (t_rot) #set rotation


Pardon my probably poor python ;)