The government is considering introducing legislation to remove Andrew Mountbatten-Windsor from the line of royal succession.